At that time I described the solution like this:
In my event sink for window events I added a handler for the OnBeforeUnload event. That event is fired when a javascript
location.reload() is executed. The event handler returns a string that will be added to a message box asking the user if
he or she wants to proceed or not. In my implementation of IDocHostShowUI::ShowMessage I trap that message before it is
displayed using the string to identify it. I supply IDCANCEL via the plResult output parameter to simulate a click on
the cancel button and return S_OK to not show the message box and voila, that's it.
Now, the problem is that this doesn't work if IE 9 is installed. With IE 9 installed it is no longer possible to trap
the message that is related to the OnBeforeUnload event handler in IDocHostShowUI::ShowMessage. It doesn't show up
there. I can trap other messages but not this one. Is this a deliberate change or is this a bug? Any help, comments or
suggestions would be greatly appreciated.
Best Regards
Jan