PDA

View Full Version : Access to the Recycle Bin (Windows)



Nedec
22nd December 2009, 18:55
Hi,

i want to create a program that overrides files a few times and then delete them. So, they can't be recovered so easily, can they?

It should be possible to do this with files, which are already in the Recycle Bin. Is there a way to access to this files? Or, failing that, is it possible to do it only on Windows - and allow to compile the program only there? (What a shame. ;))

Thank you,
Nedec

squidge
22nd December 2009, 20:54
Well, you could use SHGetSpecialFolderPath() with CSIDL_BITBUCKET as nFolder, but that will only give you meaningless filenames. A better way would be SHGetSpecialFolderLocation(), SHGetDataFromIDList() with SHGDFIL_FINDDATA and IShellFolder::EnumObjects(). A lot more tricky unless you have an understanding of shell interfaces.