ITaskbar HrInit 方法在 RemoteApp 下抛出异常 [英] ITaskbar HrInit method throws exception under RemoteApp

查看:25
本文介绍了ITaskbar HrInit 方法在 RemoteApp 下抛出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a WPF application that sometimes launches legacy VB6 windows. These VB6 windows are compiled as ActiveX DLLs and are launched ‘modally’ from the main WPF application. When the main WPF application launches the VB6 window, the VB6 window passes Me.Hwnd back to the main WPF application which uses ITaskbarList to display an icon on the Windows Taskbar. Code similar to below has worked for years ("value" is ultimately Me.Hwnd from the VB6 application).

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

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

My client is now running the application via RemoteApp and the HrInit method is throwing an exception (HResult -2146233088 / 0x80131500).

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

Is ITaskbarList functionality supported under RemoteApp? Is there a better approach to accessing the taskbar when the application is running under RemoteApp?

推荐答案

这是因为 RemoteApp 没有将 dwm/explorer.exe 作为外壳运行,而是运行自己的外壳 (rdpshell.exe).通过将 dwm/explorer 作为 shell 运行,您可以拉入整个桌面(因此您基本上运行的是远程桌面而不是 RemoteApp).

This is because RemoteApp does not run dwm/explorer.exe as a shell, instead it runs its own shell (rdpshell.exe). By running dwm/explorer as a shell, you pull in the entire desktop (so you basically run Remote Desktop rather than RemoteApp).

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

Therefore, utilities that are specific to DWM/explorer.exe are not working under RemoteApp (since there is no hosting shell and there is no taskbar etc.).

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

What are you trying to achieve? Is the RemoteApp (VB6 app) supposed to launch another app or what are you trying to achieve? Maybe we can work on fixing that.

这篇关于ITaskbar HrInit 方法在 RemoteApp 下抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆