打印本文 打印本文 关闭窗口 关闭窗口
OLE with the internet explorer
作者:武汉SEO闵涛  文章来源:敏韬网  点击数1167  更新时间:2009/4/25 0:44:55  文章录入:mintao  责任编辑:mintao

OLE with the internet explorer

uses comobj; 

procedure OpenIE(aURL: string); 
var 
  IE        : Variant; 
  WinHanlde : HWnd;  
begin  
  if( VarIsEmpty(IE) )then 
  begin  
   IE:=CreateOleObject(''''InternetExplorer.Application'''');
   IE.Visible := true;  
   IE.Navigate(aURL); 
  end  
  else  
  begin  
    WinHanlde := FindWIndow(''''IEFrame'''', nil); 
    if (0 <> WinHanlde) then 
    begin  
      IE.Navigate(aURL);  
      SetForegroundWindow(WinHanlde);  
    end  
    else 
      ShowMessage(''''Can''''''''t open IE !''''); 
  end; 
end;  


procedure TForm1.Button1Click(Sender: TObject); 
begin 
  OpenIE(''''http://www.infojet.cz/delphi/tips/''''); 
end; 

打印本文 打印本文 关闭窗口 关闭窗口