WinformHost 面板内的 WPF window
WPF window inside a WinformHost Panel
我正在另一个使用 winform 主机的 WPF 应用程序中显示 WPF exe window。
我在主应用程序中创建了一个面板并将其设置为 winformhost 的子项。
mHostingPanel = new System.Windows.Forms.Panel()
{
BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
};
mWinformHost = new WindowsFormsHost();
mWinformHost.Child = mHostingPanel;
然后我启动另一个 window 进程并将托管面板设置为父级。
WindowsAPI.SetParent(mProcess.MainWindowHandle, mHostingPanel.Handle);
我的问题是,如果我启动该应用程序,谁将渲染我的子级 WPF window,其父级是 winform panel.Will 它是面板的 Direct-X 或 GDI 上下文?
此外,如果我在子 WPF 应用程序上设置 Allowtransparency=True,UI 不会显示在托管面板中。
发现 reason.Its 所谓的 airspace 问题(当 win32 和 WPF 试图共享像素时),我不认为它可以通过任何框架解决 API 因为微软否认了它。
https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2644120-bring-back-the-hwndhost-isredirected-and-compositi
我正在另一个使用 winform 主机的 WPF 应用程序中显示 WPF exe window。
我在主应用程序中创建了一个面板并将其设置为 winformhost 的子项。
mHostingPanel = new System.Windows.Forms.Panel()
{
BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
};
mWinformHost = new WindowsFormsHost();
mWinformHost.Child = mHostingPanel;
然后我启动另一个 window 进程并将托管面板设置为父级。
WindowsAPI.SetParent(mProcess.MainWindowHandle, mHostingPanel.Handle);
我的问题是,如果我启动该应用程序,谁将渲染我的子级 WPF window,其父级是 winform panel.Will 它是面板的 Direct-X 或 GDI 上下文?
此外,如果我在子 WPF 应用程序上设置 Allowtransparency=True,UI 不会显示在托管面板中。
发现 reason.Its 所谓的 airspace 问题(当 win32 和 WPF 试图共享像素时),我不认为它可以通过任何框架解决 API 因为微软否认了它。 https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2644120-bring-back-the-hwndhost-isredirected-and-compositi