Posted on 2011-08-20 13:24
eamon 阅读(382)
评论(0) 编辑 收藏 引用 所属分类:
程序设计
void CTestBrowseDlg::OnBrowse()
{
CString str;
BROWSEINFO bi;
char name[MAX_PATH];
ZeroMemory(&bi,sizeof(BROWSEINFO));
bi.hwndOwner=GetSafeHwnd();
bi.pszDisplayName=name;
bi.lpszTitle="Select folder";
bi.ulFlags=BIF_USENEWUI;
LPITEMIDLIST idl=SHBrowseForFolder(&bi);
if(idl==NULL)
return;
SHGetPathFromIDList(idl,str.GetBuffer(MAX_PATH));
str.ReleaseBuffer();
m_Path=str;
if(str.GetAt(str.GetLength()-1)!=''\\'')
m_Path+="\\";
UpdateData(FALSE);
}