文件名称名称目前可以获取到,但是怎么获取每个文件的大小,和访问路径(可通过 Explorer 访问), 请高手赐教,相关代码如下
SHQUERYRBINFO recycleBinInfo;
ZeroMemory(&recycleBinInfo,sizeof(recycleBinInfo));
recycleBinInfo.cbSize=sizeof(recycleBinInfo);
//查询回收站信息
if (SHQueryRecycleBin(NULL,&recycleBinInfo)==S_OK)
{
fileFinder.m_totalFileSize = recycleBinInfo.i64Size;
__int64 fileNum = recycleBinInfo.i64NumItems;
}
else
{
printf("SHQueryrecycleBin Fail");
return eRTE_Cancelled;
}
IShellFolder *pisfRecBin = NULL;
SHGetDesktopFolder(&pisfRecBin);
LPITEMIDLIST pidlBin = NULL;
SHGetFolderLocation(NULL, CSIDL_BITBUCKET, NULL, 0, &pidlBin);
IShellFolder *pisf = NULL;
pisfRecBin->BindToObject(pidlBin, NULL, IID_IShellFolder, (void**)&pisf);
IEnumIDList *peidl = NULL;
pisf->EnumObjects(NULL,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN,
&peidl);
printf("\nFiles In Recycle Bin:\n");
LPITEMIDLIST pidlCurrent = NULL;
STRRET strret;
ULONG uFetched;
HANDLE hOutPut = GetStdHandle(STD_OUTPUT_HANDLE);
TCHAR szPath[MAX_PATH];
int fileNums = 0;
while (1)
{
if (S_FALSE == peidl->Next(1, &pidlCurrent, &uFetched))
break;
SHGetPathFromIDList(pidlCurrent, szPath);
pisf->GetDisplayNameOf(pidlCurrent, SHGDN_NORMAL, &strret);
UINT nSize = ILGetSize(pidlCurrent);
//strret.pOleStr 是文件名
}
8 个解决方案
#1
lz翻垃圾桶要干嘛呢?
#2
是 SHGet
SpecialFolderLocation 吧?
#3
不能说的秘密
#4
找空矿泉水瓶。
#5
http://zhanyonhu.blog.163.com/blog/static/161860442008812103918112/
#6
lz翻垃圾桶要干嘛呢?
不能说的秘密
找空矿泉水瓶。
赵老师该出手了,教教他,怎么才能找到空矿泉水瓶
#7
http://zhanyonhu.blog.163.com/blog/static/161860442008812103918112/
谢谢你,找到了答案
http://www.codeproject.com/Articles/2783/How-to-programmatically-use-the-Recycle-Bin
#8
http://zhanyonhu.blog.163.com/blog/static/161860442008812103918112/
谢谢你,找到了答案
http://www.codeproject.com/Articles/2783/How-to-programmatically-use-the-Recycle-Bin
共同学习,共同进步。
#1
lz翻垃圾桶要干嘛呢?
#2
是 SHGet
SpecialFolderLocation 吧?
#3
lz翻垃圾桶要干嘛呢?
不能说的秘密
#4
lz翻垃圾桶要干嘛呢?
不能说的秘密
找空矿泉水瓶。
#5
http://zhanyonhu.blog.163.com/blog/static/161860442008812103918112/
#6
lz翻垃圾桶要干嘛呢?
不能说的秘密
找空矿泉水瓶。
赵老师该出手了,教教他,怎么才能找到空矿泉水瓶
#7
http://zhanyonhu.blog.163.com/blog/static/161860442008812103918112/
谢谢你,找到了答案
http://www.codeproject.com/Articles/2783/How-to-programmatically-use-the-Recycle-Bin
#8
http://zhanyonhu.blog.163.com/blog/static/161860442008812103918112/
谢谢你,找到了答案
http://www.codeproject.com/Articles/2783/How-to-programmatically-use-the-Recycle-Bin
共同学习,共同进步。