function EnumChildWindowsProc(hwnd: Integer; lparam: Longint): Boolean; stdcall;<br>var<br> buffer: array[0..255] of char;<br>begin<br> Result := True;<br> GetClassName(hwnd,buffer,256);<br> if StrPas(Buffer)='Edit' then<br> begin<br> SendMessage(hwnd,WM_GETTEXT,256,lparam);<br> Result:=False;<br> end;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hwnd: Integer;<br> buffer: array[0..255] of char;<br>begin<br> hwnd := FindWindow('你对应的窗口',nil);<br> if hwnd&lt;&gt;0 then<br> begin<br> EnumChildWindows(hwnd,@EnumChildWindowsProc,Integer(@buffer[0]));<br> Caption := StrPas(buffer);<br> end;<br>end;<br>