Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
126 views
in Technique[技术] by (71.8m points)

c# - Adding Taskbar context menu to win7 application

Where can I find documentation about adding a context menu (EDIT: jumplist) to a windows 7 application? You know, when you right click on the application icon on the taskbar. Can I do that using .NET? Or do I need to use native code?

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

What I believe you are looking for is the Windows? API Code Pack and you want create a Jump List for your application.

What you see in a Jump List depends entirely on the program.Jump Lists don't just show shortcuts

to files. Sometimes they also provide quick access to commands for things like composing new e?mail messages or playing music.

Example:

using Microsoft.WindowsAPICodePack.Taskbar;
using Microsoft.WindowsAPICodePack.Shell;

JumpList list = JumpList.CreateJumpList();
JumpListCustomCategory category = new JumpListCustomCategory("Links"); 
category.AddJumpListItems(new JumpListLink("http://www.microsoft.com", "Microsoft"));
list.AddCustomCategories(category);
list.Refresh();

NOTE: The above example is untested, but it should just work?.

I do not know how to make it a command that interacts with the active instance, e.g. like iTunes tasks. I suspect they do an inter-process communication to trigger those actions.

HTH,


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...