Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display different icons for same file extension

Tags:

windows

icons

Visual Studio has *.SLN files for 2008, and 2010.

In explorer, the icon associated with the file is based on the version somehow. I was always under the impression that the associated icon just looked at the extension, but obviously there is more going on.

I'm asking on stack overflow as a developer - for my application, but if you feel this belongs on another forum, I'm happy to move the discussion elsewhere.

Thank you!

like image 638
ScottCate Avatar asked Jun 18 '10 16:06

ScottCate


2 Answers

Have a look at HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\ShellEx\IconHandler. The icon is handled by a shell extension, not the usual way with a DefaultIcon.

MSDN's Creating Icon Handlers page shows you how to create the shell extension DLL that provides the icons.

like image 123
Wim Avatar answered Sep 30 '22 18:09

Wim


I found some Delphi code at http://www.delphi3000.com/articles/article_3285.asp that seems to do the job. Maybe this can give you some inspiration.

EDIT: site does not exist anymore, using web.archive.org provided by @samir105

like image 33
Patrick Avatar answered Sep 30 '22 17:09

Patrick