Posted on 2013-03-13 15:44
盛胜 阅读(178)
评论(0) 编辑 收藏 引用
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;
}