Hwnd: THandle;webbrowser1.Navigate('http://www.hahabbmodel.com/dasai_vote_do.asp?modelid=100742');
Hwnd:=FindWindow(PChar('#32770'),PChar('Microsoft Internet Explorer'));
SendMessage(Hwnd,Vk_RETURN,0,0);
我是这么写,但是没有反应,是哪里有问题

解决方案 »

  1.   

    改成SendMessage(Hwnd,Vk_CLOSE,0,0);也不行
      

  2.   


    //**********************************************
    //自动关闭对话框
    //**********************************************
    procedure   TForm1.WMActivate(var   Msg:   TWMActivate);
    var
    S: String;
    wnd: HWND;
    I: Integer;
    begin
      Application.ProcessMessages;
     if  isliulan or isliuyan then    
      begin
      If Msg.Active = 0 then
          begin
              wnd :=  Msg.ActiveWindow;
              I := GetWindowTextLength(wnd);
              SetLength(S,I + 1);
              GetWindowText(Wnd,PChar(S),I + 1);
              If   Pos('Internet Explorer',S) > 0 then
                     Begin
                     SendMessage(Wnd,WM_CLOSE,0,0);
                  End;      end;
      end;
    end;
    //*********************************************
      

  3.   

    參考http://hi.baidu.com/szba/blog/item/b3dc20e9bb718433b90e2d2d.html
      

  4.   

    我用IDHTTP登陆成功了,但如何用WebBrowser显示登陆后的界面。就像用IDHTTP登陆csdn.net成功后,用WebBrowser打开,并没有显示登陆。抓包返回的源码显示登陆了。wininetInternetGetCookie  
    InternetSetCookie  
    这两个函数是否可以让WebBrowser显示登陆后的界面?