We use an embedded browser to show a specific webpage that has a rich text editor.
This text editor has hooked itself onto some events to detect when the browser tries to close/leave the page. The editor will validate that the latest changes are saved, and if not it will prompt the user to do so.
If the page is opened in a standalone Internet explorer, both navigating away (by typing new url), and closing the tab/window, will trigger the javascript.
When the page is shown in the embedded Iwebbrowser2 control and we send a new url, the javascript is properly triggered. But we are unable to get the event for close.
When we close the frame the control is hosted in, all the panels/controls just gets destroyed.
How do I programmatically tell the Iwebbrowser2, that we are about to close?
I have also tried to call the Quit function when I receive the onCloseEvent for my frame.
Calling Iwebbrowser2::Quit has so far not worked at all. The function does always return e_fail.
I can demonstrate it with the wxactivex sample.
I have changed it to default open this url: http://www.4guysfromrolla.com/demos/OnB ... dDemo1.htm
Closing the program does not bring up the confirmation dialog.
File:
https://dl.dropbox.com/u/13322788/wxactivex/wxactivex.zip[
^]