Click here to Skip to main content
Click here to Skip to main content

Updating Jumplists On The Fly

, 2 Feb 2010
Rate this:
Please Sign up or sign in to vote.
This article shows the basics of using jumplists; creating tasks in them linking to another excutable and updating them on the fly.

Introduction

This is a beginner's article to show how to get up and running with the new Windows 7 feature called Jumplists. When we finish, you should be able to create jumplists on the fly and add tasks to them.

Using the Code

The main jumplist code is in the form. There are a few things you need to download to use the Windows 7 API and get the DLL you need in order to start using the fun stuff in Windows 7 like Jumplists. The API link is here. Once you download it, you need to compile the DLL and then add a reference to it in your current project. The final bit to getting the jumplists to work is making sure to include the proper using syntax for them. In our case with Jumplists, you want to include:

using MS.WindowsAPICodePack.Internal;
using Microsoft.WindowsAPICodePack.Shell;	
using Microsoft.WindowsAPICodePack.Taskbar;

Once you get the includes figured out, you can jump in and create one. Make sure you create the jumplist in the FormShown event and then just add tasks as needed. The syntax below is how to create a simple task and pass an argument as well as set the icon.

IEPath = String.Format("C:\\Program Files\\Internet Explorer\\iexplore.exe");
					
JumpListLink jll = new JumpListLink(IEPath, s);
jll.IconReference = new IconReference(IEPath, 0);
jll.Arguments = txtURL.Text;

jumpList.AddUserTasks(jll);

The included demo was created to be minimized most of the time. It will scrape the current NHL.com scores site and then add the list of the current games onto a separate jumplist with a link back to the scores page. Once the timer is started, it will update the scores every timer tick which can be set in the numeric spin dial.

Once you let it run, it will update the jumplist with the current scores of the day. When you right click to get access to the jumplist, you will see something similar to the following:

Points of Interest

One tip that I learned when doing this is that you need to make sure that the icon reference is set, otherwise you get a very ugly non recognizable icon next to your tasks.

As you can see, jumplists are handy tools to get access to various items and provide extra functionality to your program. One caveat, since this was a demo I didn't follow the proper Microsoft best practices with Jumplists. You should make sure that the functionality of the jumplists are also included inside your application. In other words, anything you do in jumplists should be able to be done inside your program as well.

History

  • Initial upload: 1-31-10

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Cylentwolf

United States United States
No Biography provided

Comments and Discussions

 
GeneralMy vote of 2 Pinmemberdisore15-Feb-10 9:36 
GeneralMy vote of 2 PinmemberPhil J Pearson5-Feb-10 23:06 
GeneralMy vote of 1 Pinmemberj.avery5-Feb-10 10:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 3 Feb 2010
Article Copyright 2010 by Cylentwolf
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid