选择目录

 BROWSEINFO browse;
 ZeroMemory(&browse,sizeof(browse));
 
 CString m_strPath;
 browse.hwndOwner = NULL;
 browse.pszDisplayName = m_strPath.GetBuffer(MAX_PATH);
 browse.lpszTitle = "请您选择一个目录";
 
 LPITEMIDLIST lpItem = SHBrowseForFolder(&browse);
 if(lpItem == NULL) return ;
 
 m_strPath.ReleaseBuffer();
 if(SHGetPathFromIDList(lpItem,m_strPath.GetBuffer(MAX_PATH)) == false) return;
 
 m_strPath.ReleaseBuffer();

posted on 2006-01-20 14:54  痛并快乐着  阅读(424)  评论(0编辑  收藏  举报

导航