function EnumWindowProc(pHwnd: THandle; Edit: Integer): LongBool; stdcall;
function GetWindowTxt(gwtHwnd: THandle): string;
var dWTextBuf: PChar;
TextLen: Integer;
begin
TextLen := SendMessage(gwtHwnd, WM_GetTextLength, 0, 0);;
dWTextBuf := StrAlloc(TextLen + 1);
SendMessage(gwtHwnd, WM_GetText, TextLen + 1, Integer(dWTextBuf));
Result := dWTextBuf;
StrDispose(dWTextBuf);
end;
function GetClassNameTxt(gcnHwnd: THandle): string;
var dWClassBuf: PChar;
begin
dWClassBuf := StrAlloc(1024);
GetClassName(gcnHwnd, dWClassBuf, 1024);
Result := dWClassBuf;
StrDispose(dWClassBuf);
end;
begin
Result := LongBool(True);
if (GetClassNameTxt(pHwnd) = 'AVL_AVView') and (GetWindowTxt(pHwnd) = 'AVPageView') then
begin
TEdit(Edit).Text := GetWindowTxt(FindWindowEx(pHwnd, 0, 'RICHEDIT50W', nil));
Result := LongBool(False);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EnumChildWindows(AcroPDF1.Handle, @EnumWindowProc, LongInt(Edit1));
end;