Buat proyek baru, atur satu tombol dan memo di Form1, dan tulis kode berikut di acara OnClick Button1:
Prosedur TFORM1.BUTTON1CLICK (Pengirim: Tobject);
var
HCurrentWindow: hwnd;
sztext: array [0..254] dari char;
Mulai
hcurrentWindow: = getWindow (handle, gw_hwndfirst);
Sedangkan hcurrentWindow <> 0 do
Mulai
Jika getWindowText (hCurrentWindow, @sztext, 255)> 0 lalu
Memo1.lines.add (strpas (@sztext));
hCurrentWindow: = getWindow (hCurrentWindow, gw_hwndnext);
akhir;
akhir;