반응형
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, SHlObj, ActiveX, SHDocVw, ComObj;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure IENAV(URL: string);
private
{ Private declarations }
public
{ Public declarations }
FWebBrowser : IWebBrowser2;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IENAV(URL: string);
var
i : OleVariant ;
s: OleVariant;
begin
i:=0;
s:=URL;
FWebBrowser.Navigate2(s, i, i, i, i);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
pvShell : IShellWindows;
ovIE : OleVariant;
i : Integer;
begin
i := 0 ; //<< 몇번째 익스플로러 일까? For 문 돌려서 핸들 비교를 하셔두 모...
pvShell := CoShellWindows.Create;
ovIE := pvShell.Item(i);
if (IDispatch(ovIE).QueryInterface(IWebBrowser2, FWebBrowser) = S_OK) then begin
IENAV('http://www.delmadang.com');
end;
ovIE := Unassigned;
pvShell := nil;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, SHlObj, ActiveX, SHDocVw, ComObj;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure IENAV(URL: string);
private
{ Private declarations }
public
{ Public declarations }
FWebBrowser : IWebBrowser2;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IENAV(URL: string);
var
i : OleVariant ;
s: OleVariant;
begin
i:=0;
s:=URL;
FWebBrowser.Navigate2(s, i, i, i, i);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
pvShell : IShellWindows;
ovIE : OleVariant;
i : Integer;
begin
i := 0 ; //<< 몇번째 익스플로러 일까? For 문 돌려서 핸들 비교를 하셔두 모...
pvShell := CoShellWindows.Create;
ovIE := pvShell.Item(i);
if (IDispatch(ovIE).QueryInterface(IWebBrowser2, FWebBrowser) = S_OK) then begin
IENAV('http://www.delmadang.com');
end;
ovIE := Unassigned;
pvShell := nil;
end;
end.
반응형