cels9
asked on
IE's URL APP
I need one app that when the person views one site in IE, save the adress of the page in one .txt.
tnx
tnx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This will get the URL of EVERY currently open instance of IE, even the ones that are minimized or hidden (not shown):
procedure TForm1.Button1Click
( ASender: TObject
);
var
ShellWin : TShellWindows;
i : integer;
IE : IWebBrowser2;
begin
ShellWin := TShellWindows.Create(nil);
try
for i := 0 to ShellWin.Count-1 do
begin
try
ShellWin.Item(i).QueryInte rface(IID_ IWebBrowse r2, IE);
Memo1.Lines.Add( IE.LocationName + '->' + IE.LocationURL);
except
end;
end;
finally
ShellWin.Free;
end;
end;
procedure TForm1.Button1Click
( ASender: TObject
);
var
ShellWin : TShellWindows;
i : integer;
IE : IWebBrowser2;
begin
ShellWin := TShellWindows.Create(nil);
try
for i := 0 to ShellWin.Count-1 do
begin
try
ShellWin.Item(i).QueryInte
Memo1.Lines.Add( IE.LocationName + '->' + IE.LocationURL);
except
end;
end;
finally
ShellWin.Free;
end;
end;
function Get_URL(Servicio: string): String;
var
Cliente_DDE: TDDEClientConv;
begin
Result := '';
Cliente_DDE:= TDDEClientConv.Create( nil );
with Cliente_DDE do
begin
SetLink( Servicio,'WWW_GetWindowInf
Result := StrPas(RequestData('0xFFFF
CloseLink;
end;
Cliente_DDE.Free;
end;
procedure TForm1.Button1Click(Sender
begin
Memo1.Lines.Add( Get_URL('IExplore') );
// or for Netscape:
Memo1.Lines.Add( Get_URL('Netscape') );
end;
You can of course set this function in a Timer and check every x msec whether the URL has changed (new window/new url)...
Good luck!
Evarest