首页  编辑  

How to get address from all open IE windows

Tags: /超级猛料/OS.操作系统/IE.扩展/页面控制和交互/   Date Created:
I have a code to get only the first/active IE window url address (from delphi3000):
function Get_URL(Servicio: string): String;
var
  Cliente_DDE: TDDEClientConv;
  temp:PChar;
begin
   Result := '';
   Cliente_DDE:= TDDEClientConv.Create( nil );
    with Cliente_DDE do
       begin
          SetLink( Servicio,'WWW_GetWindowInfo');
          temp := RequestData('0xFFFFFFFF');
          Result := StrPas(temp);
          StrDispose(temp);
          CloseLink;
       end;
     Cliente_DDE.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
   Edit1.Text := Get_URL('IExplore');
end;

I tried to "play" with the code a bit...
it seems to work if i change temp := RequestData('0xFFFFFFFF') to:
temp := RequestData('1'); //1 window
or
temp := RequestData('2'); //2 window
or
temp := RequestData('3'); //3 window
and so on... until temp returns '' (empty string)
Anyway, try it.