如何在网页下载的过程中在浏览器中显示自己定义的页面或其他文字图片内容?
在下面这些事件过程中怎么写?
procedure DoDownloadBegin;
beginend;procedure DoDownloadComplete;
beginend;procedure DoBeforeNavigate2(const pDisp: IDispatch; var URL: OleVariant; var Flags: OleVariant;
                  var TargetFrameName: OleVariant; var PostData: OleVariant;
                  var Headers: OleVariant; var Cancel: WordBool);
var
begin
  if URL<>'http://www.china.com/'then begin
    Showmessage('你不可以浏览其它站点');
    Cancel:=True;
    URL:='http://www.china.com';
    (pDisp as IWebbrowser2).Navigate2(URL,Flags,TargetFrameName,PostData,Headers);
  end;   
end;procedure DoNewWindow2(var pDisp: IDispatch; var Cancel: WordBool);
begin
  IHTMLDocument2((pDisp as IWebbrowser2).Document).open('http://www.china.com', '', '', '');
end;procedure DoNavigateComplete2(const pDisp: IDispatch; var URL: OleVariant);
beginend;procedure DoDocumentComplete(const pDisp: IDispatch; var URL: OleVariant);
beginend;procedure DoOnQuit;
beginend;

解决方案 »

  1.   

    再次多谢楼上的老大,我看过你翻译的那篇关于bho的文章我现在需要在打开网页的过程中显示一些图片,自己的网页之类的,就是在用户等待的过程中显示一个广告页给他看,能不能实现?现在已经有一个软件可以实现这个功能了
    http://www.seebar.net/seejieshao.htm
    ”看吧”广告3、浏览器转换间隙:
    浏览器从一个网页转到另一个网页的过程中,有一个寻找目标网页的时间,在这段空闲的时间用户基本无事可做。系统在这一时间在浏览器中插入全屏广告,广告的最长显示时间为5秒,当浏览器找到目标网页时或显示时间超过5秒则广告消
      

  2.   

    ”看吧”广告 软件也是用delphi实现的,它的dll也是一个bho,我反编译他的dll,可以看到TWebBrowser及BeforeNavite2等
      

  3.   

    我想这样也许可以:在网页未下载完之前,我先创建一个TWebBrowser,让它显示在浏览器的文档区域,只要找到这个窗口的HWND就可以了
      

  4.   

    That would be too slow.
    You can subclass the IE window and draw the ads yourself.
      

  5.   

    这个如何:
    var
      Range: IHTMLTxtRange;
    begin
      Range := ((WebBrowser1.Document as IHTMLDocument2).body as
        IHTMLBodyElement).createTextRange;
      Range.collapse(False);
      Range.pasteHTML('<br><b>Hello!</b>');