将任务栏上下文菜单添加到win7应用程序

ast*_*cas 5 .net c# aero windows-7

在哪里可以找到有关向Windows 7应用程序添加上下文菜单(编辑:跳转列表)的文档?您知道,当您右键单击任务栏上的应用程序图标时.我可以使用.NET吗?或者我需要使用本机代码?

谢谢!

Den*_*nis 8

我相信您正在寻找的是Windows®API代码包,您需要为您的应用程序创建一个跳转列表.

您在跳转列表中看到的内容完全取决于程序.跳转列表不仅仅显示快捷方式

到文件.有时,它们还可以快速访问命令,例如撰写新电子邮件或播放音乐.

例:

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();
Run Code Online (Sandbox Code Playgroud)

注意:以上示例未经测试,但它应该正常工作.

我不知道如何使它成为与活动实例交互的命令,例如iTunes任务.我怀疑他们会进行进程间通信以触发这些操作.

HTH,

  • @Kate:真的吗?如果您已经*定位*.NET 4.0 Framework,那么您可以轻松地包含WindowsBase和WindowsPresentation程序集(即在应用程序中包含WPF). (2认同)

And*_*dre 6

如果你的意思是跳转列表,你必须使用WPF(.NET)

编辑:见这里