我有一个带有嵌入图标的普通 MFC 应用程序。如果我启动该应用程序,该图标将显示在 windows-7 任务栏中。
但是,当我更改资源内的图标、重建应用程序并启动它时,任务栏不显示当前图标,而是显示第一次运行的图标。
应用程序内部没有特殊的代码来对 windows-7 任务栏执行特定的操作。
有没有办法(在 C++ 中)告诉 windows-7 任务栏显示当前图标?
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?
发布评论
评论(3)
您是否清空/删除 shell 图标缓存?
Did you empty/delete the shell icon cache?
我相信,如果您重建一个应用程序,但它仍然以相同的名称调用,那么资源管理器认为它不应该重新加载图标,即使新图标是应用程序中唯一的图标。
如果您要发布该程序,则其他人不会遇到此问题,因为该应用程序的第一个版本将具有新图标,但出于您自己的目的,您可以调用 SHChangeNotify(); 来自 shell32.dll 以刷新您自己的图标视图。
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.
您是否从资源中删除了以前的图标...并将新图标分配给文件...放入资源后...可能会起作用...
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....