I have an Internet Explorer Browser Helper Object (BHO), written in c#, and in various places I open forms as modal dialogs. Sometimes this works but in some cases it doesn't. The case that I can replicate at present is where IE is running javascript to open other child windows... I guess it's getting a bit confused somewhere....
The problem is that when I call:
(new MyForm(someParam)).ShowDialog();
the form is not modal, so I can click on the IE window and it gets focus. Since IE is in the middle of running my code it doesn't refresh and therefore to the user it appears that IE is hanging.
Is there a way of ensuring that the form will be opened as modal, ie that it's not possible for the form to be hidden behind IE windows.
(I'm using IE7.)
NB: this is a similar question to this post although that's using java. I guess the solution is around correctly passing in the IWin32Window of the IE window, so I'm looking into that.