【发布时间】:2011-02-05 15:26:18
【问题描述】:
我想在旧版 win32 应用程序中使用 WPF 窗口。 我想以类似的方式表现它们,就像 WPF 窗口总是显示在 win32 窗口的顶部。
为此,我想将 WPF 窗口的所有者设置为 win32 窗口,但我不知道如何实现。
这里有什么帮助吗?
由于答案隐藏在某个链接后面,这里的代码可以解决问题:
System::Windows::Interop::WindowInteropHelper^ helper = gcnew System::Windows::Interop::WindowInteropHelper(myWpfChildWindow);
helper->Owner = (System::IntPtr)myMainWindowHWND;
【问题讨论】: