프로그래밍/델파이
외부 IE에 내가 원하는 페이지로 이동시키기
채윤아빠
2008. 2. 29. 15:18
use Variants, ShDocVw_TLB;
var
AWebBrowser2 : IWebBrowser2;
begin
AWebBrowser2:= GetWebBrowser2ByHWND(nProcessID);
ovURL := 'http://hbesthee.tistory.com/';
AWebBrowser2.Navigate2(ovURL, EmptyParam, EmptyParam, EmptyParam, EmptyParam);
end;
function GetWebBrowser2ByHWND(hwnd:THandle): IWebBrowser2;
var
x: Integer;
AShellWindows: IShellWindows;
AWebBrowser2:IWebBrowser2;
begin
Result := nil;
AShellWindows := CoShellWindows.Create;
for x := 0 to AShellWindows.Count - 1 do
begin
if ((AShellWindows.Item(x) <> nil)
and (AShellWindows.Item(x).QueryInterface(IWebbrowser2, AWebBrowser2) = S_OK)) then
begin
if (hwnd = AWebBrowser2.HWND) then
begin
Result := AWebbrowser2;
Exit;
end;
end;
end;
end;
728x90
반응형