Matt, I tried something similar with an nunit test, like this:

 

IntPtr hwnd =
System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;

var win = new NativeWindow();

win.AssignHandle(hwnd);

var picker = new MyPicker();

var result = picker.ShowDialog(win);

 

I was hoping that this would set the nunit app window to be the owner of the
ShowDialog, but sadly two things go wrong: (1) It's not modal, but that
might be a quirk with using the nunit window (2) The dialog doesn't appear
in the CenterParent position, it goes to screen top-left.

 

Greg

 

Reply via email to