做了个类似ie的浏览器,但是当一打开网页里面的连接的时候怎么他还是用ie打开?
还有网页所弹出的广告怎么也是在另外的窗口用ie打开啊?
要怎么样搞才能够让点击网页里面的连接的时候也依然用我的浏览器打开呢?包括弹出的
窗口也是用我的浏览器打开?
恳请指教
大家春节愉快
鸡年时时刻刻发发发

解决方案 »

  1.   

    onnewwindow2事件中指定目标浏览器如 ppdisp := webbrowser2.application;
      

  2.   

    谢谢
    但是还是有个问题啊
    就是怎么样才能够和myie或者pp点点通里面一样
    当打开一个新的连接之后
    在webbrowser下面出现那个页面的名字
    点击以后能够在不同的窗口中切换
      

  3.   

    http://www.euromind.com/iedelphi/embeddedwb/onnewwindow.htm
      

  4.   

    上楼的5颗星的兄弟
    可以在多指教吗?
    我的qq是156840268
    email:  [email protected]
    可以留下联系方法吗?
     jiangsheng(蒋晟.MSMVP2004Jan) 很想向你请教啊
      

  5.   

    Occurs when a new window is to be created for displaying a resource. Some actions that can cause this include the user shift-clicking on a link, the user right-clicking on a link and choosing "open in new window," or a targeted navigation to a frame name that does not yet exist. Your browser application can also trigger this event by calling the Navigate or Navigate2 method with the navOpenInNewWindow flag. The WebBrowser control has an opportunity to handle the new window creation itself. If it does not, a top-level Internet Explorer window is created as a separate (nonhosted) process.
    procedure TForm1.EmbeddedWB1NewWindow2(Sender: TObject;
    var ppDisp: IDispatch; var Cancel: WordBool);
       
      
    ppDisp 
    An object expression that, optionally, receives a new, hidden Webbrowser or Internet Explorer object with no URL loaded. 
    Cancel 
    A Boolean value that, when set to TRUE, is used to cancel the navigation. 
    Set Value of Cancel=TRUE to disable displaying of a new window.Set ppDisp to EmbeddedWb.Application of the webbrowser you want the url to be displayed in:procedure TForm1.EmbeddedWB1NewWindow2(Sender: TObject;
    var ppDisp: IDispatch; var Cancel: WordBool);
    begin
       ppdisp := EmbeddedWB2.Application_;
    end;
      In the following sample a new instance of your webbrowser application is created instead of a top-level Internet Explorer window. procedure TForm1.EmbeddedWB1NewWindow2(Sender: TObject;
    var ppDisp: IDispatch; var Cancel: WordBool);
    var
    NewApp: TForm1;
    begin
       NewApp := TForm1.Create(Owner);
       NewApp.Visible := true;
       ppdisp := NewApp.EmbeddedWB1.Application_;
    end;
     
    这是什么意思啊?有哪位大侠可以把他翻译成中文吗?小生e文菜鸟,恳请指教
      

  6.   

    翻译上段英文,顺便学习!OnNewWindow2事件触发条件:
      创建一个新的窗口去显示网页时发生,  一些动作将会导致这种事件的发生,包括用户shift-clicking(这个不好翻译,自己意会吧)一个连接,或者用户右击一个连接,在弹出菜单中选择‘在新窗体中打开’,又或者在一个窗体中输入一个还没有输入的网络地址.WebBrowser类在使用Navigate或者Navigate2方法时也可以触发OnNewWindow2事件     WebBrowser组件提供提供了控制新产生窗口的方法,如果用户不编写这个方法,那么默认的internet浏览器就会弹出来,显示新网页.(这就楼主说的东东吧)
               
          下面就是用来控制新产生窗口的过程.       procedure TForm1.EmbeddedWB1NewWindow2(Sender: TObject;
    var ppDisp: IDispatch; var Cancel: WordBool);      其中:
               参数ppDisp表示:接受到一个新的,隐藏的没有载入URL的浏览器对象.  
               参数Cancel表示一个bool值,如果设置为true将会取消新窗口的显示.
               可以Cancel的值设置为true取消新窗口的显示.可以设置ppDisp的值来确定在何处显示新
               的窗口内容.如下:procedure TForm1.EmbeddedWB1NewWindow2(Sender: TObject;
    var ppDisp: IDispatch; var Cancel: WordBool);
    begin
       ppdisp := EmbeddedWB2.Application_;
    end;在下面的列子中将会产生一个新的WebBrowser实例来替代,在点击连接时漠认产生的微软的internet浏览器
     procedure TForm1.EmbeddedWB1NewWindow2(Sender: TObject;
    var ppDisp: IDispatch; var Cancel: WordBool);
    var
    NewApp: TForm1;
    begin
       NewApp := TForm1.Create(Owner);
       NewApp.Visible := true;
       ppdisp := NewApp.EmbeddedWB1.Application_;
    end;这下楼主应该没有问题了吧.