type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function EnumWindowsFunc(Handle: THandle; List: TStringList) : boolean ; stdcall;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Clear;
EnumWindows(@EnumWindowsFunc, LParam(Memo1.Lines));
end;
function EnumWindowsFunc(Handle: THandle; List: TStringList) : boolean ; stdcall;
var Caption: array[0..256] of Char;
begin
if GetWindowText
(Handle, Caption, SizeOf(Caption)-1) <> 0 then
begin
List.Add(Caption);
SetWindowText(Handle, PChar('About - ' + Caption));
end;