c# - JumpLists 在 C# 应用程序中不起作用

标签 c# windows windows-7

我正在尝试在我的 C# 应用程序中使用 Recent 和 Frequent JumpLists。我正在使用 Windows API 代码包 v1.1 (http://code.msdn.microsoft.com/WindowsAPICodePack)。每次应用启动时我都会初始化 JumpList,每次在应用中打开项目时我都会将 AddRecent() 添加到 JumpList。

缺少某些东西,因为当您右键单击任务栏中的应用程序图标时,JumpLists 根本没有显示。我有一个文件只显示一次,仅此而已!

初始化:

    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();
        }
    }

打开项目:

    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.
        }
    }

我错过了什么?

最佳答案

this page 发生了什么?与您遇到的问题密切相关?

关于c# - JumpLists 在 C# 应用程序中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4572544/

相关文章:

c++ - OpenSSL::SSL_library_init() 内存泄漏

c# - 无法访问对象实例

c# - 为对象分配属性

c# - Visual Studio Code - C# 控制台应用程序

windows - 如何将变量从 Windows 批处理文件传递到 SQL*Plus

windows - 如何将项目添加到右键单击文件夹菜单?

c++ - Windows 管道到 C++ 程序

c# - Win 7 中的 "pin to desktop",兼容 XP

c++ - 在 cygwin 上找不到 tchar.h

c# - 在 lambda 表达式中引用当前对象