views:

239

answers:

3

I have a normal MFC Application with an embedded icon. If I start the application, the icon is shown inside the windows-7 taskbar. But when I change the icon inside the resources, rebuild the application and start it, the taskbar doesn't show the current icon, but the icon from the first run.

There is no special code inside the application that does something specific with the windows-7 taskbar.

Is there a way, (in C++) to tell the windows-7 taskbar to show the current icon?

+1  A: 

Did you empty/delete the shell icon cache?

Anders
Windows-7 seems to have another place for the icon-cache; I would be happy, if other people won't need to kill explorer, to see the new icon.
Florian W.
It is a hidden file, turn on show hidden/system files in explorer.If the icon cache is the issue, it would only affect your machine. (Assuming that changing the resources is not part of your programs normal operation)
Anders
A: 

did your remove the previous icon from resource....and assign the new icon to the file..too after putting in the resource...might that would work....

deepu
I had edited the .ico file - and rebuild; There is only 1 icon in the executable; but even adding the icon several times, doesn't change the situation.
Florian W.
+1  A: 

I believe that if you rebuild an application, but it's still called by the same name, then explorer doesn't think it should reload the icon, even though the new icon is the only one in the app.

If you were to release the program, no-one else would have this problem since the first version of the app would have the new icon, but for your own purposes you can call SHChangeNotify(); from shell32.dll to refresh your own view of the icon.

fneep