如何用delphi关闭不是用delphi创建打开的ie浏览器?

解决方案 »

  1.   

    运行,点按钮,可以关闭本浏览器!procedure TForm1.Button1Click(Sender: TObject);
    var
      hwnd1: Hwnd;
    begin
      hwnd1 := FindWindow(nil, '对浏览器编程熟的人来看一下 - Microsoft Internet Explorer');
      if hwnd1 <> 0 then
      begin
        SendMessage(hwnd1, WM_CLOSE, 0, 0);
      end;
    end;
      

  2.   

    //关闭IE及其它应用
    void CloseIE()
    {
      int app=BSM_APPLICATIONS;
      unsigned long  bsm_app=(unsigned long )app;
      BroadcastSystemMessage(BSF_POSTMESSAGE,&bsm_app,
                             WM_CLOSE,NULL,NULL);
    }
      

  3.   

    #define BSM_APPLICATIONS        0x00000008
    #define BSF_POSTMESSAGE         0x00000010
      

  4.   

    http://expert.csdn.net/Expert/topic/1923/1923268.xml?temp=.3507044
    帮帮忙吧