刚看了一个例子,哈哈。
uses FileCtrl, ShlObj;
procedure TForm1.btnBrowseClick(Sender: TObject);
var
bi: TBrowseInfo;
pidl: pItemIdList;
strpath: string;
begin
bi.hwndOwner := Handle;
bi.pidlRoot := nil;
bi.pszDisplayName := '';
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;