新しいプロジェクトを作成し、Form1に1つのボタンとメモを配置し、Button1のOnClickイベントに次のコードを記述します。
手順tform1.button1click(sender:tobject);
var
hcurrentwindow:hwnd;
sztext:charの配列[0..254]。
始める
hcurrentWindow:= getWindow(handle、gw_hwndfirst);
hcurrentWindow <> 0
始める
getWindowText(hcurrentWindow、@sztext、255)> 0の場合
memo1.lines.add(strpas(@sztext));
hcurrentWindow:= getWindow(hcurrentWindow、gw_hwndnext);
終わり;
終わり;