Activex OLE Delphi

procedure TFmMain.GotoUrl(SUrl: string; Width, Height: Integer; ToolBar: Boolean);
const
csOLEObjName = 'InternetExplorer.Application';
var
IE : Variant;
WinHanlde : HWnd;
begin
if( VarIsEmpty( IE ) )then
begin
IE := CreateOleObject( csOLEObjName );
IE.Visible := true;
IE.Toolbar := Toolbar;
if Width > 0 then IE.Width := Width;
if Height > 0 then IE.Height := Height;
IE.Navigate( sURL );
end else
begin
WinHanlde := FindWIndow( 'IEFrame', nil );
if( 0 <> WinHanlde )then
begin
IE.Navigate( sURL );
SetForegroundWindow( WinHanlde );
end else
begin
ShowMessage('Internet Explorer acilamadi');
end;
end;
end;

// kullanimi:
{adresi yukseklik ve genislik belirtmeden acar }
GotoUrl('http://www.delphiturk.com', 0, 0, True);
{adresi yukseklik ve genislik belirterek toolbar
olmayan bir pencerede acar }
GotoUrl('http://www.delphiturk.com', 400, 400, False);