开发者

Pin to taskbar event in Window 7

Is there a way to handle "Pin this program to taskbar" user action in the code? Is there such an event in Taskbar API? My search didn't give any results.

The reason behind this: my X.exe is launched through some other Y.exe executable, and if user clicks 'Pin' while Y.exe is running, I want to change this shortcut to开发者_Python百科 the actual X.exe.

Any ideas? Thanks.


Since it is possible to pin to taskbar an application that is not running it is possible to do it programatically as well. Since no information on it can be found, I suggest these ways of investigation:

  • create a test app with unique name, pin it to taskbar and search the registry for any entry with app's name
  • use Spy++ or an equivalent to see what messages are passed in the taskbar during the pin operation


I don't think this is possible. And I think it would also be kind of a security concern if it was possible to programmatically have a different application be pinned to the taskbar than the one which is running. I mean in your case you want to prevent the wrong application from being pinned... but what if other applications would try to exploit this and pin stuff which the user didn't want?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜