zoukankan      html  css  js  c++  java
  • 选择路径对话框

    CString CPublicFuncs::GetFilePath(CString title)
    {
        CString   strFilePath;   
        TCHAR   pszBuffer[_MAX_PATH];   
        BROWSEINFO   bi;   LPITEMIDLIST   pidl;   
        bi.hwndOwner   
    =   NULL;   
        bi.pidlRoot   
    =   NULL;   
        bi.pszDisplayName   
    =   pszBuffer;   
        bi.lpszTitle   
    =   title;   
        bi.ulFlags   
    =   BIF_RETURNFSANCESTORS   |   BIF_RETURNONLYFSDIRS;   
        bi.lpfn   
    =   NULL;   
        bi.lParam   
    =   0;   
        
    if((pidl   =   SHBrowseForFolder(&bi))   !=   NULL)   
        
    {   
            
    if(SHGetPathFromIDList(pidl,   pszBuffer))   
            
    {   
                CString   strTemp(pszBuffer);       strFilePath   
    =   strTemp;   
                
    if   (strFilePath.GetLength()   <=   1)     
                
    {   
                }
       
                
    else   if   (strFilePath.Right(1)   !=   _T("\\"))     
                    strFilePath   
    +=   _T("\\");   
            }
       
        }
       
        
    return strFilePath;
    }
  • 相关阅读:
    【学习笔记】最小表示法
    bzoj1912【Apio2010】patrol 巡逻
    hdu1057
    hdu1056
    hdu1055
    hdu1054
    hdu1053
    hdu1052
    hdu1051
    hdu1050
  • 原文地址:https://www.cnblogs.com/strinkbug/p/743226.html
Copyright © 2011-2022 走看看