procedure TForm1.Button3Click(Sender: TObject);
var
ShellWindow: IShellWindows;
nCount: integer;
spDisp: IDispatch;
i: integer;
vi: OleVariant;
IE1: IWebBrowser2;
IDoc1: IHTMLDocument2;
begin
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
for i := 0 to nCount - 1 do
begin
vi := i;
spDisp := ShellWindow.Item(vi);
spDisp.QueryInterface( iWebBrowser2, IE1 );
if IE1 <> nil then
begin
memo1.Lines.Add( 'Location: '+ie1.LocationName );
IE1.Document.QueryInterface(IHTMLDocument2,iDoc1);
if iDoc1 <> nil then
begin
memo1.Lines.add( 'Title: ' + IDOC1.Title );
memo1.Lines.add( 'Url: ' + IDOC1.url);
end;
end;
end;
end;