Posts: 1,337
Threads: 61
Joined: Jul 2006
what is the proper syntax for enumerating files in the recycle bin
i know u must use these functions but cannot sort of the proper syntax in qm
SHQueryRecycleBin SHQUERYRBINFO
was looking for an example
Posts: 12,087
Threads: 142
Joined: Dec 2002
Macro
enumerate Recycle Bin
out
IShellFolder sfD sfRB
ITEMIDLIST* pidlRB pidl
SHGetDesktopFolder(&sfD)
SHGetSpecialFolderLocation(0 CSIDL_BITBUCKET &pidlRB)
sfD.BindToObject(pidlRB 0 IID_IShellFolder &sfRB)
CoTaskMemFree pidlRB
IEnumIDList en
sfRB.EnumObjects(0 SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN &en)
rep
,en.Next(1 &pidl &_i); if(_hresult) break
,STRRET sr; sfRB.GetDisplayNameOf(pidl 0 &sr)
,word* w; StrRetToStrW(&sr pidl &w)
,str s.ansi(w)
,CoTaskMemFree w
,CoTaskMemFree pidl
,out s
http://www.codeproject.com/Articles/278 ... ecycle-Bin
Posts: 1,337
Threads: 61
Joined: Jul 2006
thank you works great
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
Is it possible to extend this useful example including each file's size?
Thanks
Posts: 12,087
Threads: 142
Joined: Dec 2002
Macro
enumerate Recycle Bin
out
IShellFolder2 sfD sfRB
ITEMIDLIST* pidlRB pidl
SHGetDesktopFolder(&sfD)
SHGetSpecialFolderLocation(0 CSIDL_BITBUCKET &pidlRB)
sfD.BindToObject(pidlRB 0 IID_IShellFolder2 &sfRB)
CoTaskMemFree pidlRB
str s1 s2 s3 s4; str* sp=&s1; int i
SHELLDETAILS sd
;column headers
for i 0 4
,sfRB.GetDetailsOf(0 i &sd)
,sp[i].FromSTRRET(sd.str)
out "<><Z 0xff00>%-25s %-50s %-20s %-20s</Z>" s1 s2 s3 s4
IEnumIDList en
sfRB.EnumObjects(0 SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN &en)
rep
,en.Next(1 &pidl &_i); if(_hresult) break
,
,;;location
,;STRRET sr; sfRB.GetDisplayNameOf(pidl 0 &sr)
,;str s.FromSTRRET(sr pidl)
,;out s
,
,;columns
,for i 0 4
,,sfRB.GetDetailsOf(pidl i &sd)
,,sp[i].FromSTRRET(sd.str pidl)
,s3.findreplace("[0xe2][0x80][0x8e]"); s3.findreplace("[0xe2][0x80][0x8f]") ;;right-to-left mark etc
,out "%-25s %-50s %-20s %-20s" s1 s2 s3 s4
,
,CoTaskMemFree pidl
,
Member function
str.FromSTRRET
function$ STRRET&sr [ITEMIDLIST*pidl]
word* w
StrRetToStrW(&sr pidl &w)
ansi(w)
CoTaskMemFree w
ret this
Posts: 1,058
Threads: 367
Joined: Oct 2007
Great! Many thanks, Best Personal Regards.