本例效果图(测试时, 我打开了: 搜狐、谷歌和我的博客):

代码文件:
--------------------------------------------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Align := alTop;
Memo1.ScrollBars := ssBoth;
Memo1.Clear;
end;
procedure TForm1.Button1Click(Sender: TObject);
const
className = 'IEFrame'; {这是 IE 浏览器的类名}
var
h: HWnd;
buf: array[Byte] of Char;
begin
h := GetWindow(Handle, GW_HWNDFIRST);
while h <> 0 do
begin
GetClassName(h, buf, Length(buf));
if buf = className then {找到咋处理? 显示它的标题吧}
begin
GetWindowText(h, buf, Length(buf));
Memo1.Lines.Add(buf)
end;
h := GetWindow(h, GW_HWNDNEXT);
end;
end;
end.