浏览文件夹对话框

BROWSEINFO bInfo;
ZeroMemory(&bInfo, sizeof(bInfo));
bInfo.hwndOwner = m_hWnd;
bInfo.lpszTitle = "请选择路径: ";
bInfo.ulFlags = BIF_RETURNONLYFSDIRS;    
LPITEMIDLIST lpDlist; //用来保存返回信息的IDList
lpDlist = SHBrowseForFolder(&bInfo) ; 
if (lpDlist == NULL)
{
return;
}
if(lpDlist != NULL)  
{
CHAR chPath[MAX_PATH]; //用来存储路径的字符串
SHGetPathFromIDList(lpDlist, chPath);
m_strSavePath    = chPath; //将TCHAR类型的字符串转换为CString类型的字符串
//strOutPath = chPath;
}

你可能感兴趣的:(浏览文件夹对话框)