Получение текста из адресной строки explorera

15:24
function PrintEnumProc(Wnd: HWND; LParam: LPARAM): BOOL; stdcall;
const
MaxTextSize = 1024;
var
PrText: array[0..MaxTextSize] of char;
begin
Result := True; { continue enumerating }
windows.GetClassName(Wnd,PrText,MaxTextSize);
if PrText='Edit' then begin
SendMessage(Wnd, WM_GETTEXT, MaxTextSize, longint(@PrText));
TMemo(Pointer(LParam)^).Lines.Add(PrText);
Result:=false;
end;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
var
W: HWND;
begin
Memo1.Clear;
W := FindWindow('ExploreWClass', nil);
if W = 0 then
raise Exception.Create('Explorer window not found');
EnumChildWindows(W, @PrintEnumProc, LPARAM(@memo1));
end;