views:

64

answers:

2

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!

+3  A: 

If you mean the jumplist, you have to do it using WPF (.NET)

EDIT: See here

Andre
thank you, jumplist... that's its name!
astorcas
+5  A: 

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,

Dennis Roche
thank you, that's useful!
astorcas
you will not need the Windows API Code pack if you are targeting .NET 4.0 or later (it is built in).
Dennis Roche
so I need it if I'm developing a .NET 3.5 app. Don't I?
astorcas
@Dennis some Win7 stuff (including jumplists) is built in to WPF. If @astorcas is not using WPF then the Code Pack is still needed even at .NET 4.
Kate Gregory
@Kate: Really? If you already *targeting* the .NET 4.0 Framework then you can easily include the WindowsBase and WindowsPresentation assemblies (i.e. include WPF in the application).
Dennis Roche