ITaskbar HrInit方法在RemoteApp下抛出异常

ITaskbar HrInit method throws exception under RemoteApp

我有一个 WPF 应用程序有时会启动旧版 VB6 windows。这些 VB6 windows 被编译为 ActiveX DLL,并从主 WPF 应用程序“模态”启动。当主 WPF 应用程序启动 VB6 window 时,VB6 window 将 Me.Hwnd 传递回主 WPF 应用程序,后者使用 ITaskbarList 在 Windows 任务栏上显示图标。类似于下面的代码已经工作多年(“值”最终来自 VB6 应用程序 Me.Hwnd)。

private ITaskbarList _taskbar;
_taskbar = (ITaskbarList)new CoTaskbarList();
_taskbar.HrInit();
_taskbar.AddTab((IntPtr)value);

我的客户端现在是 运行 通过 RemoteApp 的应用程序并且 HrInit 方法抛出异常 (HResult -2146233088 / 0x80131500)。

RemoteApp 是否支持 ITaskbarList 功能? 当应用程序在 RemoteApp 下 运行 时,是否有更好的方法来访问任务栏?

这是因为 RemoteApp 没有 运行 dwm/explorer.exe 作为 shell,而是 运行 它自己的 shell (rdpshell.exe).通过 运行 宁 dwm/explorer 作为 shell,你拉入了整个桌面(所以你基本上 运行 远程桌面而不是 RemoteApp)。

因此,特定于 DWM/explorer.exe 的实用程序无法在 RemoteApp 下运行(因为没有托管 shell 并且没有任务栏等)。

你想达到什么目的? RemoteApp(VB6 应用程序)是否应该启动另一个应用程序或您想要实现什么?也许我们可以解决这个问题。