Re: Dynamic application icon loaded
You could do something manually in the RC file like this:
http://www.developer.com/net/cplus/article.php/627551
And even #include different icons based on the solution. Otherwise, you
will have to update the registry to tell it to use the icon that you want
from the EXE (or elsewhere)
If your application has permission you can change:
HKEY_CLASSES_ROOT\.ext
..ext should be your extension and this will point to another key like:
HKEY_CLASSES_ROOT\MyProgram.KeyType
That has two sub keys:
HKEY_CLASSES_ROOT\MyProgram.KeyType\DefaultIcon
HKEY_CLASSES_ROOT\QuickDisc.DiscSet\Shell
DefaultIcon has the default icon information:
c:\Source\vs8\Release\MYPROG~1.EXE,28
The ,28 is the index into the program of the icon you want to display.
The Shell key can have one or more subkeys depending on how your program
interacts with the shell like:
HKEY_CLASSES_ROOT\QuickDisc.DiscSet\Shell\Open\Command
containing:
c:\Source\vs8\Release\MYPROG~1.EXE "%1"
That tells the shell how to open your program.
There is other user specific information under key:
HKEY_CURRENT_USER\Software\Classes
For the document extension, but I don't think you can change the icon
there. Just how the shell opens the program.
Tom
"Matrixinline" <anup.kataria@gmail.com> wrote in message
news:472d244b-24ed-4876-89cb-6bfac7a109b0@s9g2000prg.googlegroups.com...
Hi All,
Is there is a way to update the application icon run time. I also wish
to change the icons appear on the explorer window dynamically.
SetIcon will change the application icon on its window but not of the
file icon visible in a explorer window.
I could think of updating the resource but is needs to write a
different app. I do not wish to go with this solution. is there any
other way.