zoukankan      html  css  js  c++  java
  • 【转】显示一个打开文件夹的对话框,并得到用户选择的目录:

       char szDir[MAX_PATH];
       BROWSEINFO bi;
       ITEMIDLIST *pidl;
       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;
       if(!SHGetPathFromIDList(pidl, szDir)) 
       return;
       AfxMessageBox(szDir); //szDir中存放的内容为用户选定的目录
  • 相关阅读:
    bzoj1098 1301
    bzoj3237
    bzoj3170
    bzoj4008
    一些题解
    bzoj4028
    bzoj3196
    redis学习
    quartz学习
    电商618 压测、优化、降级预案
  • 原文地址:https://www.cnblogs.com/2018shawn/p/9283814.html
Copyright © 2011-2022 走看看