WPF window with Delphi Form as Owner

Hi,

If I have a Delphi host application and a WPF window created by a non visual plugin, how do i set the owner of the created WPF window to the main form of my Delphi host?

I want the WPF window to be on top of the main window without using ShowDialog or Topmost=“True”.

/Kristofer

Hello

While not being a Hydra specialist, I can tell that probably you’ll need to pass the handle of your host Win32 (aka Delphi) window to your WPF plugin and there set the owner of the window using the http://msdn.microsoft.com/en-us//library/system.windows.interop.windowinterophelper.aspx class:

WindowInteropHelper wih = new WindowInteropHelper(myDialog);
wih.Owner = ownerHwnd;
myDialog.ShowDialog();

Hope that helps

1 Like

Exactly what I needed. Thanks for the help!