Windows 7 任务栏 - 跳转列表、跳转列表链接和跳转列表项

发布于 2024-08-12 04:10:32 字数 422 浏览 7 评论 0原文

我正在使用 Microsoft .NET Framework 的 Windows API 代码包来尝试 Win7 任务栏的一些新 UI 功能。我正在用 C# 编码。

我有一个关于跳转列表的问题。提供的所有示例代码均假定跳转列表上的条目用于调用运行特定应用程序或打开文档,例如 MRU 列表中的文本文档或运行 mspaint.exe。

我想实现一些允许我在自己的应用程序(即与任务栏交互的应用程序)中设置状态的项目。例如,当您可以设置状态(忙碌、离线等)时,MSN Messenger 就会执行此操作。

尽我所能,我无法创建 JUmpListItem 或 JumpListLink 来以这种方式运行 - 它将它们视为应用程序或文档。

有谁有关于如何创建一个在创建它的同一应用程序中引发事件的项目的示例吗?我确信这很简单,但我很愚蠢。

非常感谢您的帮助。

I am using the Windows API Code Pack for Microsoft .NET Framework to try out of some of the new UI features of the Win7 taskbar. I am coding in C#.

I have a question regarding jumplists. All of the sample code provided assumes that the entries on the jump list are used to call out to run a particular application or open a document, e.g. a text document in a MRU list or run mspaint.exe.

I would like to implement some items which allow me to set state in my own application (i.e. the app which is interacting with the taskbar). MSN Messenger does this, for example, when you can set your status (Busy, Offline etc.).

Try as I might, I cannot create a JUmpListItem or JumpListLink to behave in this way - it treats them as applications or documents.

Does anyone have any samples of how to create an item which raises an event in the same application that created it? I am sure it is simple but I am being very daft.

Many thanks for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

决绝 2024-08-19 04:10:32

我相信您想要做的是使用一组特殊的标志来调用您的应用程序(即使用某些参数启动可执行文件)。在应用程序启动时,您将检查设置了哪些标志,然后向应用程序的主实例发送消息,然后退出新实例。

I believe what you'd want to do is to call your application with a special set of flags (i.e. launch the executable with certain arguments). At application start up, you'd check to see what flags are set, then send a message to the main instance of the application and then exit out of the new instance.

莫相离 2024-08-19 04:10:32

使用TaskBarDemo,要打开由您的应用程序创建的项目,必须引用它,即,如果您的程序创建了一个PDF 文件,您将执行以下操作:

jumpList.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRD32.exe"), "Open Adobe Reader")
        {
            IconReference = new IconReference(Path.Combine(systemFolder, "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRD32.exe"), 0)
        });

否则,您必须确保您的应用程序为最近或频繁的项目注册了文件关联。

我在使用 API Pack 时遇到了一些跳转列表问题,我现在使用 VS 2010 Beta 2 并让 shell 处理跳转列表。

希望这有帮助。

Using the TaskBarDemo, to open an item created by your application would have to be referenced, ie if your program created a PDF file you would do this:

jumpList.AddUserTasks(new JumpListLink(Path.Combine(systemFolder, "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRD32.exe"), "Open Adobe Reader")
        {
            IconReference = new IconReference(Path.Combine(systemFolder, "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRD32.exe"), 0)
        });

Otherwise you would have to ensure that your application registered file associations, for recent or frequent items.

I had a few problems with jumplists with the API Pack, i now use VS 2010 Beta 2 and let shell handle the jumplists.

Hope this is helpfull.

扶醉桌前 2024-08-19 04:10:32

这些任务是某种 IShellLink。然后,您应该调用 ICustomDestinationList 的 AddUserTasks。在 Windows 7 培训套件中查找示例。

These tasks are some sort of IShellLink. Then, you should call ICustomDestinationList's AddUserTasks. Look up samples in Windows 7 Training Kit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文