1 在浏览网页的时候,怎么样才能禁止javascript产生的小窗口?并且所有打开的网页都在WebBrowser里显示。2 在163.com中,当我填写了用户ID和密码时,以前可以按回车就能进行身份验证,可现在得点确认按钮,如何叫回车还能继续使用呢?3 如何判断是否有前一个和后一个网址,如果没有就像IE那样是不可用,有的话可用。4 如何判断一段字符串是网址。5 怎么样才能实现双击自动滚屏。6 我怎么能长分啊?呵呵,新手,没玩过。系统怎么不让多给分啊,我有后退了一把(刚才给了120^_^)。

解决方案 »

  1.   

    1.http://expert.csdn.net/Expert/topic/2106/2106304.xml?temp=.6326258
    2.不知道
    3.procedure TForm1.WebBrowser1CommandStateChange(Sender: TObject;
      Command: Integer; Enable: WordBool);
    begin
      case Command of
        CSC_NAVIGATEBACK:    btnBack.Enabled := Enable;
        CSC_NAVIGATEFORWARD: btnForword.Enabled := Enable;
      end;
    end;
    4.暂时没有
    5.没做过
    6.多回答问题就会长分等你有了几个三角裤就可以多给分,不要告诉我你不知道怎么结贴:)
      

  2.   

    WebBrowser其实是调用IE的接口,因此要屏蔽IE中的功能比较难办,因为它仅仅是接口,你只能使用接口提供的功能。
    1、网络实名的上网助手就有这个功能,但是它是控制整个IE,属于add-ins开发
    2、不大清楚
    3、想通过OleObject接口控制,没成功
    4、字符串解析,但是网址理论上是没有规则的
    5、可以在载入后,将双击后滚屏的javascript代码用WebBrowser1.OleObject.document.write()写到html文档中
    6、多回答问题
      

  3.   

    滚动uses
      MSHTML;procedure WebBScroll(WB: TWebBrowser; X, Y: Integer);
    begin
      ((WB.Document as IHTMLDocument2).parentWindow as IHTMLWindow2).scroll(X ,Y);
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      WebBScroll(WebBrowser1, 10, 400);
    end; 
      

  4.   

    回车,这个应该可以放一个ApplicationEvents,剩下的就不用你管了procedure TFrmMain.ApplicationEvents1Message(var Msg: tagMSG;
      var Handled: Boolean);
    const
      StdKeys = [VK_TAB, VK_RETURN]; { standard keys }
      ExtKeys = [VK_DELETE, VK_BACK, VK_LEFT, VK_RIGHT]; { extended keys }
      fExtended = $01000000; { extended key flag }
    begin
      Handled := False;
      with Msg do
      if ((Message >= WM_KEYFIRST) and (Message <= WM_KEYLAST)) and
          ((wParam in StdKeys) or {$IFDEF VER120}(GetKeyState(VK_CONTROL) < 0) or {$ENDIF}
          (wParam in ExtKeys) and ((lParam and fExtended) = fExtended)) then
        try
          if IsChild(GetVisibleWebBrowser.Handle, hWnd) then
          { handles all browser related messages }
          begin
            with GetVisibleWebBrowser.Application as IOleInPlaceActiveObject do
              Handled := TranslateAccelerator(Msg) = S_OK;
            if not Handled then
            begin
              Handled := True;
              TranslateMessage(Msg);
              DispatchMessage(Msg);
            end;
          end;
        except end;
    end; // IEMessageHandler
      

  5.   

    不好意思 ,有点事,现在才回,全部代码:unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, AppEvnts, OleCtrls, SHDocVw,activex;type
      TForm1 = class(TForm)
        WebBrowser1: TWebBrowser;
        ApplicationEvents1: TApplicationEvents;
        procedure ApplicationEvents1Message(var Msg: tagMSG;
          var Handled: Boolean);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
      var Handled: Boolean);
    const
      StdKeys = [VK_TAB, VK_RETURN]; { standard keys }
      ExtKeys = [VK_DELETE, VK_BACK, VK_LEFT, VK_RIGHT]; { extended keys }
      fExtended = $01000000; { extended key flag }
    begin
      Handled := False;
      with Msg do
      if ((Message >= WM_KEYFIRST) and (Message <= WM_KEYLAST)) and
          ((wParam in StdKeys) or {$IFDEF VER120}(GetKeyState(VK_CONTROL) < 0) or {$ENDIF}
          (wParam in ExtKeys) and ((lParam and fExtended) = fExtended)) then
        try
          if IsChild(webbrowser1.Handle, hWnd) then
          { handles all browser related messages }
          begin
            with webbrowser1.Application as IOleInPlaceActiveObject do
              Handled := TranslateAccelerator(Msg) = S_OK;
            if not Handled then
            begin
              Handled := True;
              TranslateMessage(Msg);
              DispatchMessage(Msg);
            end;
          end;
        except end;
    end; // IEMessageHandlerprocedure TForm1.FormCreate(Sender: TObject);
    begin
        webbrowser1.Navigate('www.163.com');
    end;end.