我想在旧版 win32 应用程序中使用 WPF 窗口。我想以类似的方式表现它们,就像 WPF 窗口总是显示在 win32 窗口的顶部。
为此,我想将 WPF 窗口的所有者设置为 win32 窗口,但我不知道如何实现这一点。
这里有什么帮助吗?
由于答案隐藏在某个链接后面,这里的代码可以做到这一点:
System::Windows::Interop::WindowInteropHelper^ helper = gcnew System::Windows::Interop::WindowInteropHelper(myWpfChildWindow);
helper->Owner = (System::IntPtr)myMainWindowHWND;