Delete a file to the recycle bin from C++
Friday, November 14th, 2008Today, I was looking for a way to delete a file to the recycle bin using C++, but couldn’t find any simple example, so here it is:
SHFILEOPSTRUCT operation; operation.wFunc = FO_DELETE; operation.pFrom = "c:\\file\to\delete.txt"; operation.fFlags = FOF_ALLOWUNDO; SHFileOperation(&operation);