How to get the resource ID of an embedded icon file?

G

Gavin

Hi

I want to associate a file extension, '.xpf', with my
application. However, I do not want to use the
application's icon but anther icon, something similar to
Word and Excel documents icons.

So I need to embed the document icon into the .exe file
and add into the .inf file something like:

[RegData] ; registry key list
HKCR,.xpf,,,MyCompany.MyApp
HKCR,MyCompany.MyApp\DefaultIcon,,,"%InstallDir%\%
AppName%.exe,-123"

where 123 is the resource ID of the icon embedded into
the .exe file.

It this possible in .NET Compact Framework? IF it is how
do I get the resource ID of the icon embedded in the .exe
file?

Help

Gavin
 
G

Gavin

I don't want to use the default icon to associate the
files with my application. I want to do something like
what Word and Excel does, they have their own document
icons.

Anyway, I embedded the document icon into my application.
Then using a Resource Explorer (PE Module Explorer) I
could not find the icon. So, I guess .NET CF embeds the
icons differently (except for the default icon). I then
used the Resource Explorer to add the my document icon
and now it works, I can associate my files with a
different icon, not the application's default icon. But
it's not a nice solution because every time I rebuild my
application I'll need to manually add the document icon
using the Resource Explorer!

Regards

Gavin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top