分类: C/C++
2007-05-17 14:34:14
CString strPath;
BROWSEINFO bInfo;
LPITEMIDLIST pidl;
ZeroMemory ( (PVOID) &bInfo,sizeof (BROWSEINFO));
bInfo.hwndOwner = this->m_hWnd;
bInfo.pszDisplayName = strPath.GetBuffer (MAX_PATH);
bInfo.lpszTitle = "";
bInfo.ulFlags = BIF_RETURNFSANCESTORS|BIF_RETURNONLYFSDIRS;
bInfo.lpfn = NULL;
bInfo.lParam = 0;
if ((pidl = ::SHBrowseForFolder(&bInfo)) == NULL)
return;
if (::SHGetPathFromIDList(pidl,strPath.GetBuffer(MAX_PATH)) == FALSE)
return;