JumpLists Not Working in C# App
Posted
by
Josh M.
on Stack Overflow
See other posts from Stack Overflow
or by Josh M.
Published on 2010-12-31T22:19:06Z
Indexed on
2011/01/01
3:53 UTC
Read the original article
Hit count: 234
Hi, I'm trying to use the Recent and Frequent JumpLists in my C# app. I'm using the Windows API Codepack v1.1 (http://code.msdn.microsoft.com/WindowsAPICodePack). I initialize the JumpLists every time the app starts and I AddRecent() to the JumpList every time I open a project in the app.
Something is missing becuase the JumpLists are simply not showing up when you right click the app's icon in the Taskbar. I got one file to show up once but that's it!
Initialization:
private void InitializeJumpLists()
{
if (TaskbarManager.IsPlatformSupported)
{
JumpList recentJumpList = null;
JumpList frequentJumpList = null;
TaskbarManager.Instance.ApplicationId = Application.ProductName;
recentJumpList = JumpList.CreateJumpList();
recentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent;
recentJumpList.Refresh();
frequentJumpList = JumpList.CreateJumpList();
frequentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Frequent;
frequentJumpList.Refresh();
}
}
Opening the Project:
private void OpenProject(string path, bool isFromRecentFilesList)
{
DialogResult result = ConfirmProjectClosing();
if (result == DialogResult.Yes)
Save();
else if (result == DialogResult.Cancel)
return;
using (new Wait())
{
//Code here opens the project, etc.
//Try to add the file to the Jump List.
if (TaskbarManager.IsPlatformSupported)
JumpList.AddToRecent(path);
//Code here finished up.
}
}
What am I missing?
© Stack Overflow or respective owner