[red]uses ShlObj;[/red]
procedure TForm1.Button1Click(Sender: TObject);
var
bi: TBrowseInfo;
pidl: pItemIdList;
strpath, displayname: string;
begin
SetLength (displayname, 100);
bi.hwndOwner := Handle;
bi.pidlRoot := nil;
bi.pszDisplayName := pChar (displayname);
bi.lpszTitle := 'Select a folder';
bi.ulFlags := bif_StatusText;
bi.lpfn := nil;
bi.lParam := 0;
pidl := ShBrowseForFolder (bi);
SetLength (strPath, 100);
ShGetPathFromIdList (pidl, PChar(strPath));
Edit1.Text := strPath;
end;