根据MSDN
与 JumpTask 一起使用的图标必须可作为本机资源使用。
您只能从单独的资源文件加载图标。因此,您需要IconResourcePath使用图标设置 DLL 的属性。如果您的图标很少,请使用IconResourceIndex属性来指定所需的图标。
例如,下一个代码
<Application x:Class="YourApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<JumpList.JumpList>
<JumpList>
<JumpTask Title="TargetApp"
Description="JumpTask to start TargetApp"
ApplicationPath="TargetApp.exe"
IconResourcePath="LibWithIcons.dll"
IconResourceIndex="2" />
</JumpList>
</JumpList.JumpList>
</Application>
Run Code Online (Sandbox Code Playgroud)
将创建 JumpList 并从LibWithIcons.dll设置为 JumpTask 项TargetApp 第三个图标(基于 null 的计数)。顺便说一下,如果JumpTask启动另一个应用程序,通常会被设置为该应用程序的可执行文件,因此会显示它的图标:IconResourcePath
<JumpTask Title="TargetApp"
Description="JumpTask to start TargetApp"
ApplicationPath="TargetApp.exe"
IconResourcePath="TargetApp.exe"
IconResourceIndex="0" />
Run Code Online (Sandbox Code Playgroud)
MSDN 论坛上描述了如何创建图标 DLL 。