I have parent window with its owner set via WindowInteropHelper.
Parent.Owner equals null in this case.
Is there any way to get the handle of the form owning the window?
I need this for dialog windows. When I try to set closed dialog window as the owner I get the exception.
Thus I want to set dialog’s owner to be the owner of another dialog. But it is WinForm and DialogWindow.Owner equals null.
WinForm (via WindowInteropHelper-> WPF Parent Dialog (closed) -> WPF Child Dialog
To get handle of the WinForms form that owns the specific WPF Window you can use the following code:
To get handle of any window (WinForms or WPF) that owns the specific window (WinForms or WPF) you can use the following code: