Crie um novo projeto, organize um botão e memorando no Form1 e escreva o código a seguir no evento OnClick do Button1:
procedimento TForm1.Button1Click (remetente: TOBJECT);
var
HcurrentWindow: HWND;
SzText: Array [0..254] de Char;
Começar
hcurrentWindow: = getWindow (alça, gw_hwndfirst);
enquanto hcurrentwindow <> 0 do
Começar
Se GetWindowText (HcurrentWindow, @sztext, 255)> 0 Então
Memor1.lines.add (strpas (@sztext));
HcurrentWindow: = getWindow (hcurrentwindow, gw_hwndnext);
fim;
fim;