Mega Code Archive

 
Categories / Delphi / LAN Web TCP
 

How to open Internet Explorer via OLE

Title: How to open Internet-Explorer via OLE Question: How to navigate IE with OLE automation ? Answer: 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 // errorhandling end; end;