我想在传统的win32应用程序中使用WPF窗口.我想以类似的方式表现它们,就像WPF窗口始终显示在win32窗口之上.
为此,我想将WPF窗口的所有者设置为win32窗口,但我不知道如何实现这一点.
这里有什么帮助?
由于答案隐藏在一些链接后面,这里的代码就是诀窍:
System::Windows::Interop::WindowInteropHelper^ helper = gcnew System::Windows::Interop::WindowInteropHelper(myWpfChildWindow);
helper->Owner = (System::IntPtr)myMainWindowHWND;
Run Code Online (Sandbox Code Playgroud)