Open a non modal WPF window that's always on top (like gh)


(Alain Cormier) #1

Hi,

How can I open a WPF window from a command that’s always on top but non modal (like the gh main window)?

myWindow.Topmost = true;
myWindow.Show();
will do it but that brings the window on top of every other window on the desktop even if Rhino is not in focus and I don’t want that.

I’m using C# and RhinoCommon.

Thanks,
Alain


(Steve Baer) #2

Hi Alain,
I haven’t done this lately, but I would search for “wpf set parent hwnd” on google.


(Alain Cormier) #3

Hi Steve,

That search let me to the solution:
new System.Windows.Interop.WindowInteropHelper(myWindow).Owner = Rhino.RhinoApp.MainWindowHandle();

Thanks much!
Cheers,
Alain