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中存放的内容为用户选定的目录
  • 相关阅读:
    UVA
    codeforces #371div2 B
    POJ-3278 Catch That Cow
    巴士博弈
    权势二进制
    HDU
    SQL 函数
    SQL 查询语句×45
    SQL 触发器
    SQL 连接查询
  • 原文地址:https://www.cnblogs.com/2018shawn/p/9283814.html
Copyright © 2011-2022 走看看