Pinning advertised shortcuts on the taskbar in windows 7

主宰稳场 提交于 2019-11-28 08:46:58

问题


My application launches using an advertised shortcut in the Windows Start Menu. This means the shortcut doesn't link directly to my exe, though the exe is ultimately what runs.

My problem is: when I right click the shortcut in the Windows 7 taskbar and select Pin to Taskbar, and then launch my application, I end up with two icons in the taskbar. (So the running app does not re-use the existing taskbar icon.) Does anyone know how to fix this?

Unfortunately, the choice of using an advertised rather than a direct shortcut is not up to me.

By the way, there is another way to pin a program to the taskbar in Windows 7: right click the icon of the running application. If I do it this way, I don't end up with the duplicate icons, so I'm fairly certain the problem is the advertised shortcut.

Thanks, Amy


回答1:


In this case you need to use explicit AppUserModelID. When you create the shortcut you can specify AppUserModelID. At the same time you also need to specify the same AppUserModelID at the following places: all running windows or process, file association, jumplist.

For more information about AppUserModelID you can reference http://msdn.microsoft.com/en-us/library/dd378459(VS.85).aspx.



来源:https://stackoverflow.com/questions/1330939/pinning-advertised-shortcuts-on-the-taskbar-in-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!