I want to delete a file into recycle bin. I using this code.
SHFILEOPSTRUCT FileOp;
FileOp.hwnd = NULL;
FileOp.wFunc=FO_DELETE;
FileOp.pFrom= lpFileName; //it's my value \\?\C:\WorkFolder\qweqw.docx
FileOp.pTo = NULL;
FileOp.fFlags=FOF_ALLOWUNDO|FOF_NOCONFIRMATION;
FileOp.hNameMappings=NULL;
int t_res = SHFileOperation(&FileOp); // t_res = 124
return t_res;
What’s i doing wrong? Thanks in advance.
t_res, it should give the error code and suggest the reasonpFromtakes files, not single file, so you should terminate the buffer with two zeros, see doc excerpt from MSDN: