2

I have a program which has two different modes that users can be in. Depending on the mode I want to change the taskbar icon to reflect its state. I've found application.icon will allow me to set any image I want at run time, but there was one problem. When I installed the program, a shortcut is created for the start menu. The shortcut appears to disable the ability to change icon for the task bar. Is there any way to ignore the shortcut icon?

4

1 回答 1

1

快捷方式与应用程序图标在任务栏上的显示方式无关,
快捷方式仅指向将图标嵌入为资源的实际可执行文件。

您的问题可能是 Windows 图标缓存。这是图标缓存未正确更新的常见情况。你应该重建/刷新你的图标缓存,然后你应该看到当前加载的应用程序图标出现在任务栏上,然后你可以使用Application.Icon.Load...在模式之间交换图标。

这也可能只是由于您的任务栏选项。如果您将任务栏设置为将两者结合起来,Icon + Label则图标不会更改。确保该选项设置为不合并或仅在任务栏已满时合并。

于 2013-06-12T15:33:17.267 回答