Josh M.
Josh M.

Reputation: 27831

JumpLists Not Working in C# App

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?

Upvotes: 4

Views: 906

Answers (3)

Have you registered the file extension with your application ? (I was the missing part in my case to get it work)

Upvotes: 0

Josh M.
Josh M.

Reputation: 27831

This turned out to be a limitation of ClickOnce deployments. Using a normal setup project, after installation the Jump Lists work as expected.

Upvotes: 2

Jesse C. Slicer
Jesse C. Slicer

Reputation: 20157

Is what's happening at this page germane to the issue you're seeing?

Upvotes: 2

Related Questions