开发者

New instance on Taskbar middle-click / shift+click

In Windows 7, some programs allow the user to launch multiple instances by middle clicking / shift+clicking on the taskbar item (ex: Paint, Notepad, Visual Studio...)

However, none of the applications I create exhibit this behavior. The middle click function will make the button glow, but fail to open another instance unless I pin the program to the taskbar first (which is not required for Paint/Notepad/etc to still be able to open new instances)

What is the secret to allowing a WPF application to properly create new instances like the above listed programs?

I've tried searching, but I have onl开发者_如何转开发y come up with jumplist/tasks or single-instance program results.


The secret here is called shortcut. To get this behavior, you have to create a shortcut to your program, to the start menu, the desktop or the taskbar. When a shortcut is present, Windows finds it from the running program, even if it has been started by a totally different way (command line, explorer, etc...) and middle clicking or shift-clicking on the open program icon in the taskbar simply executes the shortcut.

This is easily verifiable: remove the shortcut for Notepad from the start menu and you won't be able to middle click it anymore! Change the shortcut by adding an argument to it (a text file path) and the file will be opened in notepad by shift-clicking on the taskbar icon.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜