Dan Inactive
Dan Inactive

Reputation: 10070

Windows programming: setting different icons for the different file types handled by your application

How do you go about setting different icons for the different file types handled by your application in Microsoft Windows?

Even just a high-level explanation will help.

Thanks, Dan

Upvotes: 1

Views: 218

Answers (4)

kichik
kichik

Reputation: 34744

Most file associations are defined under HKEY_CLASSES_ROOT. In There, you define a class for each file extension. For example, under HKCR\.txt you'll find txtfile as the default value. If you go to HKCR\txtfile, you'll find all the actions associated with this class, including open under HKCR\txtfile\shell and the icon under HKCR\txtfile\DefaultIcon.

MSDN has some more information.

Upvotes: 1

Homde
Homde

Reputation: 4286

File extensions and their icons are controlled through the registry

Here's some more info on how to do it with a deployment project, most installers like installshield that's included for free have similar features

http://www.c-sharpcorner.com/uploadfile/scottlysle/customfiletype12082006000848am/customfiletype.aspx

Upvotes: 1

Steven Spielberg
Steven Spielberg

Reputation:

In visual studio

Microsoft use a trick to handle this situation.

he make a dll and he put all icon on them. in system registry he make the rule that how they show the icon for ascx and aspx. he put the file extension as name and icon as value.

when visual studio run visual studio read the system registry and show the icon.

if you don't believe this you can read this in your regedit if you have visual studio in your system.

Upvotes: 0

Mudassir
Mudassir

Reputation: 13194

Assign the icons to the files in Windows registry. You can give icons in a dll just like Windows' shell32.dll.

Upvotes: 0

Related Questions