就像图中那样,在打开某个目录的同时可以选择多个文件。网上查到可以用Explorer.exe /select实现这样的效果,但是我不知道Explorer.exe能不能选择多个文件

c++如何打开某个文件夹并选中多个文件
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- threenewbee 2019-08-21 22:47关注
//Directory to open ITEMIDLIST *dir = ILCreateFromPath(_T("C:\\")); //Items in directory to select ITEMIDLIST *item1 = ILCreateFromPath(_T("C:\\Program Files\\")); ITEMIDLIST *item2 = ILCreateFromPath(_T("C:\\Windows\\")); const ITEMIDLIST* selection[] = {item1,item2}; UINT count = sizeof(selection) / sizeof(ITEMIDLIST); //Perform selection SHOpenFolderAndSelectItems(dir, count, selection, 0); //Free resources ILFree(dir); ILFree(item1); ILFree(item2);
https://stackoverflow.com/questions/9355/programmatically-select-multiple-files-in-windows-explorer
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报