활성화 된 익스플로어의 URL을
델파이를 이용해서 바꾸고 싶은 데 가능한가요?
가능하하다면 어떻게 해야하나요?
아래의 소스대로 하면 현재의 활성화된 브라우저에서
URL이 변경되는 것이 아니라 새로운 브라우저가 생성되면서
그곳에 URL이 변경되는 군요.
도움 부탁합니다.
program iexplor;
uses
Windows, ComObj;
procedure OpenInternetExplorer( sURL : string );
const
csOLEObjName = 'InternetExplorer.Application';
var
IE : Variant;
WinHanlde : HWnd;
begin
if( VarIsEmpty( IE ) )then
begin
IE := CreateOleObject( csOLEObjName );
IE.Visible := true;
IE.Navigate( sURL );
end else
begin
WinHanlde := FindWIndow( 'IEFrame', nil );
if( 0 <> WinHanlde )then
begin
IE.Navigate( sURL );
SetForegroundWindow( WinHanlde );
end else
begin
// handle error ...
end;
end;
end;
begin
OpenInternetExplorer( 'microsoft.com' );
end.