Créez un nouveau projet, organisez un bouton et un mémo dans Form1 et écrivez le code suivant dans l'événement OnClick de Button1:
Procédure tform1.button1Click (expéditeur: tobject);
var
HCurrentWindow: Hwnd;
sztext: array [0..254] de char;
Commencer
hcurrentwindow: = getWindow (manche, gw_hwndfirst);
tandis que HcurrentWindow <> 0 fait
Commencer
Si getWindowText (hcurrentwindow, @sztext, 255)> 0 alors
Memo1.lines.add (strpas (@sztext));
hcurrentwindow: = getwindow (hcurrentwindow, gw_hwndnext);
fin;
fin;