Search code examples
c#resourcesiconsfile-association

How do you embed a resource so that it can be accessed for icons?


I have a C# project using VS2005. Basically I have two icons, one for the application, and one for files that are associated with the application.

I have associated these files with the application, and I know how to set their icons in the Registry, but I can only set them to the application icon because it seems to be the only external resource.

I've tried having the icons either in a resource file (.resx), or as a seperate file (.ico) which is compiled into the exe at compile time, but neither work.

To show what I mean, I've built the app and opened it with Resource Hacker, and you'll notice only one of the two icons is there, using one icon and one icon group.

http://img442.imageshack.us/img442/3189/resourcesx.jpg http://img442.imageshack.us/img442/3189/resourcesx.jpg


Solution

  • In the end I just stored the .ico in a resource file embedded in the .exe and then extracted it to its AppData folder for Explorer to use.