标程: 浏览文件夹&对文件夹的处理

来源:互联网 发布:淘宝购买万艾可的流程 编辑:程序博客网 时间:2024/05/28 15:08

 TCHAR strFilePath[200];
 BROWSEINFO strBrowseInfo; //"浏览文件夹"的结构信息
 //Contains parameters for the SHBrowseForFolder function
 //and receives information about the folder selected by the user.

 memset(&strBrowseInfo, 0, sizeof(strBrowseInfo));//set
 strBrowseInfo.ulFlags = BIF_RETURNONLYFSDIRS;//set

 ITEMIDLIST *pItemIdList = SHBrowseForFolder(&strBrowseInfo); //显示"浏览文件夹"
 SHGetPathFromIDList(pItemIdList, strFilePath); //从"浏览文件夹"获得文件夹路径
 ::RemoveDirectory(strFilePath);