procedure TForm1.btn1Click(Sender: TObject); var h: HWnd; p: array[0..254] of char; TitleStr: string; begin h := GetWindow(Handle, GW_HWNDFIRST); while h <> 0 do begin if GetWindowText(h, @p, 255) > 0 then begin TitleStr := StrPas(p); if AnsiPos(‘计算器‘,TitleStr)>0 then //查找比较是否>0 begin mmo1.Lines.Add(p); end; end; h := GetWindow(h, GW_HWNDNEXT); end; end;
时间: 2024-11-02 18:57:12