قم بإنشاء مشروع جديد ، وترتيب زر واحد ومذكرة في Form1 ، واكتب الكود التالي في حدث OnClick Button1:
الإجراء tform1.button1click (المرسل: tobject) ؛
var
hcurrentwindow: hwnd ؛
sztext: Array [0..254] of Char ؛
يبدأ
hcurrentwindow: = getWindow (مقبض ، gw_hwndfirst) ؛
بينما hcurrentwindow <> 0 تفعل
يبدأ
إذا كان getWindowText (hcurrentwindow ، sztext ، 255)> 0 ثم
memo1.lines.add (strpas (sztext)) ؛
hcurrentwindow: = getWindow (hcurrentwindow ، gw_hwndnext) ؛
نهاية؛
نهاية؛