uses ShlObj;function GetUserSelectDirectory(TitleName: string; WithCreateDir: boolean; var DisplayName: string): string;var lpItemID : PItemIDList; BrowseInfo : TBrowseInfo; DispName : array[0..MAX_PATH] of char; TempPath : array[0..MAX_PATH] of char;begin Result := ''; FillChar(BrowseInfo, sizeof(TBrowseInfo), #0); BrowseInfo.hwndOwner := 0; BrowseInfo.pszDisplayName := @DispName; BrowseInfo.lpszTitle := PChar(TitleName); if WithCreateDir then BrowseInfo.ulFlags :=BIF_EDITBOX or $40 else BrowseInfo.ulFlags :=BIF_EDITBOX; lpItemID := SHBrowseForFolder(BrowseInfo); if lpItemId <> nil then begin SHGetPathFromIDList(lpItemID, TempPath); Result := string(PChar(string(TempPath))); DisplayName := string(PChar(string(DispName))); GlobalFreePtr(lpItemID); end;end;//пример использованияprocedure TForm1.Button2Click(Sender: TObject);var s: string;begin Edit1.Text := GetUserSelectDirectory('Выберите каталог', True, s);end;