Category: ActiveX
Title: OLE with the internet explorer
Date added: 15.03.2006
Hits: 8578
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;