Re: Dynamic application icon loaded
"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.
Explorer will show the first icon in your .exe's resources. You can use the
API's like e.g. UpdateResource() to change the first icon.
But then you need to tell Explorer to update it's icon cache. There is a
per-user file called iconcache.db which you can delete, but then you need to
restart Explorer in order for it to generate the new one. Not a good
solution. Perhaps an alternative (I haven't tried it) is to use the API's
to move your app to the Recycle Bin, and then restore it to it's original
location. Maybe that will cause Explorer to show your (new) first icon.
-- David