下你所需,载你所想!
汇集开发技术源码资料

遍历并显示回收站中的文件

:213.375KB :1 :2021-11-02 14:28:30

部分简介

pszPath = 取空白文本 (#MAX_PATH)
SHGetDesktopFolder (pisfRecBin)
SHGetMalloc (pMalloc)
SHGetFolderLocation (#NULL, #CSIDL_BITBUCKET, #NULL, 0, pidlBin)
IID_IShellFolder = { 230, 20, 2, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }
COM_调用COM方法 (pisfRecBin, 5, pidlBin, #NULL, 取指针_字节集型 (IID_IShellFolder), 取指针整数_ (pisf), , , , , , )
COM_调用COM方法 (pisf, 4, #NULL, 位或 (#SHCONTF_FOLDERS, #SHCONTF_NONFOLDERS, #SHCONTF_INCLUDEHIDDEN), 取指针整数_ (peidl), , , , , , , )
.判断循环首 (真)
.如果真 (COM_调用COM方法 (peidl, 3, 1, 取指针整数_ (idlCurrent), 取指针整数_ (uFetched), , , , , , , ) = #S_FALSE)
跳出循环 ()
.如果真结束
SHGetPathFromIDListA (idlCurrent, pszPath)
strret = LocalAlloc (#LMEM_ZEROINIT, 264)
COM_调用COM方法 (pisf, 11, idlCurrent, #SHGDN_NORMAL, strret, , , , , , , )
pOleStr = 指针_到整数 (strret + 4)
dwSize = lstrlenW (pOleStr)
szBuf = 指针到字节集 (pOleStr, dwSize × 2 + 2)
LocalFree (strret)
调试输出 (pszPath, 编码_Unicode到Ansi (szBuf))
.判断循环尾 ()
COM_Release (pMalloc)
COM_Release (peidl)
COM_Release (pisf)

热门推荐

相关文章