strDlgTitle)     
{   
    static TCHAR   szDir[MAX_PATH];  
        ZeroMemory(szDir, MAX_PATH
*sizeof(TCHAR)):
 
    BROWSEINFO   bi;   
        ZeroMemory(
&bi, sizeof(BROWSEINFO)):

    ITEMIDLIST   
*pidl = NULL;   
    bi.hwndOwner   
=   this->m_hWnd;   
    bi.pidlRoot   
=   NULL;   
    bi.pszDisplayName   
=   szDir;   
    bi.lpszTitle   
=   strDlgTitle;   
    bi.ulFlags   
=   BIF_RETURNONLYFSDIRS;   
    bi.lpfn   
=   NULL;   
    bi.lParam   
=   0;   
    bi.iImage   
=   0;   
    pidl   
=   SHBrowseForFolder(&bi);   
    
if(pidl   ==   NULL)   return   _T("");   
    
if(!SHGetPathFromIDList(pidl,   szDir))   return   _T("");   
    
return   CString(szDir);     
}

// testing code
CString strFolderPath = CXXXDlg::ShowSelectDirectoryDlg(_T("选择源码目录"));

相关文章:

  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2021-05-15
  • 2021-10-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案