谢谢!也可以这么作:
function GetTextFromOtherWindow(Hwnd:Integer;UInt:Integer):Boolean;stdcall;
var TextBuf:array[0..255] of char;
begin
SendMessage(Hwnd,WM_GETTEXT,255,Integer(@TextBuf));
Form1.Memo1.Text := TextBuf;
end;
procedure TForm1.Button1Click(Sender: TObject);
var LParam: Integer;
begin
LParam := 0;
EnumChildWindows(GetDeskTopwindow,@GetTextFromOtherWindow,LParam);
end;