views:

46

answers:

3

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

A: 

I do not think it can be done. YOu may have to resort to a C++ project where you can embedd the icons in a way that can be recognized by the shell. Note that this does not mean the dll has to contain anything else ;) But I don't think .NET assemblies can contain shell compatible resources.

TomTom
But application icons are accessible by shell, so there must be a way, maybe by editing the project file?
fneep
A: 

I believe you can do this by invoking the C# compiler directly. This MSDN topic seems to contain useful information.

Working with Resources Using csc.exe

João Angelo
A: 

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.

fneep