Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Anatomy of the Windows 7 taskbar – Jumplist (Part 1)

0.00/5 (No votes)
1 Apr 2010 1  
Anatomy of the Windows 7 taskbar – Jumplist (Part 1)

The last topic I want to cover about the Windows 7 taskbar is the Jumplist!!!

To create a new JumpList, call CreateJumpList():

C#
JumpList jumplist = JumpList.CreateJumpList();

We should now choose if we are only creating user tasks or custom categories? I decided to create user tasks:

C#
jumplist.AddUserTasks(new JumpListLink(Path.Combine
  (Environment.CurrentDirectory, "MiMail.exe"), "Mail") { Arguments = "mail" });
jumplist.AddUserTasks(new JumpListLink(Path.Combine
  (Environment.CurrentDirectory, "MiMail.exe"), "Contacts") { Arguments = "contacts" });
jumplist.AddUserTasks(new JumpListLink(Path.Combine
  (Environment.CurrentDirectory, "MiMail.exe"), "Calendar") { Arguments = "calendar" });

We could also use custom categories to group our tasks:

C#
JumpListCustomCategory category = new JumpListCustomCategory("Mail");
category.AddJumpListItems(new JumpListLink(Path.Combine
  (Environment.CurrentDirectory, "MiMail.exe"), "Inbox") { Arguments = "inbox" });
category.AddJumpListItems(new JumpListLink(Path.Combine
  (Environment.CurrentDirectory, "MiMail.exe"), "New Message") 
  { Arguments = "newMessage" });
jumplist.AddCustomCategories(category);

Don't forget to call Refresh():

C#
jumplist.Refresh();

Now, if you read my previous blog post and had no clue why you would want to use it? JumpList allows you to specify an application (and its arguments) to be executed if you click on a user task!!!

Cool, isn't it?

To remove all the user tasks:

C#
jumplist.ClearAllUserTasks();

User tasks is also available if the application is pinned to the taskbar (if not removed)!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here