Try handling NavigateError
event on the underlying WebBrowser ActiveX control. I have an example showing how handle the "underlying" WebBrowser
events like that. It's for WPF, but it can be easily adapter for WinForms (using WebBrowser.ActiveXInstance
).
Alternatively, I think you should be able to handle this kind of messages by implementing IDocHostShowUI::ShowMessage
. I have another example showing how to implement IDocHostUIHandler
on WebBrowser
site object. The same approach can be used for IDocHostShowUI
.
Disclaimer: I haven't verified either of these two potential solutions.