gpt4 book ai didi

c# - 将项目添加到任务栏应用程序菜单

转载 作者:太空狗 更新时间:2023-10-30 00:08:02 25 4
gpt4 key购买 nike

我有一个应用程序。我想通过 C# 将我的特定项目添加到右键单击应用程序的任务栏菜单中。我想同时添加永久项目和临时项目。

如果我没有让你明白,这就是我所说的菜单:

enter image description here

最佳答案

此功能称为 JumpList,适用于 Windows 7。它是 Microsoft API 的一部分。如何在 C# 中使用它已被详细记录 herehere .

为了能够处理 Windows 窗体中的 Jumplist 类,您必须包含这些 DLL(Microsoft.WindowsAPICodePack.dllMicrosoft.WindowsAPICodePack.Shell.dll) 在你的项目中。您可以从 this CodeProject project 获得它们或者您可以从 WindowsAPICodePack 下载开源库其中包括可用于访问 Windows 7 和 Windows Vista 功能的源代码。您需要在代码顶部添加两个用法:

using Microsoft.WindowsAPICodePack.Taskbar;
using Microsoft.WindowsAPICodePack.Shell;

任何 Jumplist 都由类别组成,每个类别都有自己的 Jumptask。 WindowsAPICodePack目前支持两种类型的JumptaskJumplistLinkJumplistSeperatorJumptask 表示用户要执行的操作,例如打开应用程序的新实例或启动另一个程序。这些 Jumptask 分组在名为 JumplistCustomCategories 的类别中。

关于c# - 将项目添加到任务栏应用程序菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13478089/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com