代码:
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ShdocVW, StdCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    ListBox1: TListBox;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
  xWin:IShellWindows;
  xWeb:IWebbrowser;
  i:Integer;
begin
  xWin:=CoShellWindows.Create;
  for i:=0 to xWin.Count-1 do begin
    xWeb:=xWin.Item(i) as IWebbrowser;
    ListBox1.Items.Add(xWeb.LocationURL);
  end;
end;end.

解决方案 »

  1.   

    以前的贴子的:
    Function GetURL(H:hwnd;lparam:longint):boolean;stdcall;
    var str,url:array [0..254] of char;
      begin
        getclassname(h,@str,255);
        if strpas(@str)='ComboBoxEx32' then // ComboBoxEx32可以改成Edit.
          begin
          SendMessage(h,WM_GETTEXT,255,LongInt(@url));
          form1.ListBox1.Items.Add(strpas(@url));
          end;
          result:=true;
      end;
    function callbackproc(H:HWnd;lparam:longint):Boolean;stdcall;
    var str:array [1..255] of char;
      begin
      getclassname(h,@str,255);
      if ((strpas(@str)='CabinetWClass') or (strpas(@str)='IEFrame')) then
          begin
            Enumchildwindows(h,@GetURL,0);
          end;
          result:=true;
      end;procedure TForm1.findbuttonClick(Sender: TObject);
    begin
        listbox1.Clear;
        Enumwindows(@callbackproc,0);
    end;
      

  2.   

    //uses DDEManprocedure TForm1.Button1Click(Sender: TObject);
    var
      DDE: TDdeClientConv;
    begin
      DDE := TDdeClientConv.Create(self);
      if DDE.SetLink('IExplore','WWW_GetWindowInfo' ) then
        Label1.Caption := DDE.RequestData( '0xFFFFFFFF, sURL, sTitle' )
      else
        ShowMessage( 'IE is not running' );
      DDE.Free;end;