I use C #, MSHTML, and InternetExplorer objects to work through a web page, but I got hooked on the problem.
Basically, I noticed that in IE7 or earlier, when window.showModalDialog is called, the NewWindow3 event is fired.
In IE8 and IE9, NewWindow3 never starts. As MSDN writes: “The NewWindow3 event is fired only when a new instance of Internet Explorer is created. A call to showModalDialog or showModelessDialog does not raise an event because they are not new instances of Internet Explorer. They are implemented as MSHTML host windows, which allows them to display and display HTML content but not hyperlinks between documents. " (Http://msdn.microsoft.com/en-us/library/aa768337 (v = VS.85) .aspx)
The only way I could get closer to capturing a modal dialog — but I don't have access to the real modal object — is using the WindowStateChanged event. This event is usually called, but I noticed that when dwFlags == 1 and dwValidFlagsMask == 3, it usually happens when the browser shuts down due to a modal dialog ...
Now I need to know how to get this modal dialog object. Any help would be greatly appreciated.
source
share