SHFileOperation – Pogopixels’ Blog http://pogopixels.com/blog Just another WordPress weblog Thu, 17 Mar 2016 13:29:10 +0000 en-US hourly 1 https://wordpress.org/?v=4.7.9 Delete a file to the recycle bin from C++ http://pogopixels.com/blog/delete-a-file-to-the-recycle-bin-from-cp/ http://pogopixels.com/blog/delete-a-file-to-the-recycle-bin-from-cp/#comments Fri, 14 Nov 2008 21:16:34 +0000 http://pogopixels.com/blog/?p=57 Today, 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);
]]>
http://pogopixels.com/blog/delete-a-file-to-the-recycle-bin-from-cp/feed/ 1