OLE Control window handle error with WebBrowser and Delphi 2007

a 夏天 提交于 2019-12-02 08:18:05

It is caused by the html form being closed. The vendor's forums show some code that will fix the problem. http://www.bsalsa.com/forum/showthread.php?t=255

Set Cancel to True in the OnWindowClosing event and navigate to an empty page if it is the main webbrowser. In case your webbrowser is a popup window, you may want to close the form the EWB is on.

procedure TForm2.EmbeddedWB1WindowClosing(ASender: TObject; IsChildWindow: WordBool; var Cancel: WordBool);
begin
  Cancel := True;
  (ASender as TEmbeddedWB).GoAboutBlank;
end;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!