svět, kde se rodí nová budoucnost   
 
Delphi headDelphi Tips

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; 

Back to Index of Tips

 

 

Send mail to radek.novak@infojet.cz with questions or comments about this web site.
Copyright © 1999-2002 Infojet.cz
Last modified: 26.07.2002