BROWSEINFO bi; char name[MAX_PATH]; ZeroMemory(&bi,sizeof (BROWSEINFO)); bi.hwndOwner = GetSafeHwnd(); bi.pszDisplayName = name; bi.lpszTitle = " 选择文件夹 " ; //bi.ulFlags = BIF_USENEWUI; bi.ulFlags = BIF_RETURNFSANCESTORS; LPITEMIDLIST idl = SHBrowseForFolder(&bi); if (idl == NULL) return ; SHGetPathFromIDList(idl, folderPath.GetBuffer(MAX_PATH)); folderPath.ReleaseBuffer();