我有一个使用C#编写的Internet Explorer浏览器小助手对象(BHO),在各个地方我以模态对话框形式打开表单。有时这有效果,但在某些情况下不起作用。目前我可以复制的情况是,当IE正在运行JavaScript以打开其他子窗口时......我猜它在某个地方有点混淆....
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.