We were wrong. The exact time we get the error is when the webpage tries to
run a Java script line that closes the browser:
self.close();
This causes the TWebBrowser control to destroy itself. And therefore the
application cannot find the window handle to the control!
BUT how do we trap this "self.close" action? We tried TWebBrowser.OnQuit,
but that one did not fire!
Regards,
Peter Graversen
> This causes the TWebBrowser control to destroy itself. And therefore the
> application cannot find the window handle to the control!
> BUT how do we trap this "self.close" action? We tried TWebBrowser.OnQuit,
> but that one did not fire!
I solved this by using a timer, I am interested in cleaner solution too.
Regards
Peter Graversen, Denmark.
-----------------------------------
definition in Form:
procedure ParentNotify(var Msg: TMessage); message WM_PARENTNOTIFY;
implementation of message handler:
procedure TMyForm.ParentNotify(Var Msg: TMessage);
begin
if (msg.WParamLo = WM_DESTROY) and (msg.LParam = ie.Handle) then close;
end;
Remark: ie is the TWebBrowser control on the form
"Krasimir Stoyanov" <kras...@krasimir.com> wrote in message
news:3BB2294E...@krasimir.com...
> After digging into it, i found that the form where the TWebBrowser control
> actually lies on, gets a WM_PARENTNOTIFY message.
> So by trapping the message in the form with the code belov it actually
> works.
Thank you!