Hi all,
In the code below, I want to call windows API to delete a file to recycle bin. This is my first try to use winAPI. Please, can anybody tell me where is the error?
Code:#include <stdio.h> #include <windows.h> int main() { SHFILEOPSTRUCTA fileOp; fileOp.wFunc = FO_DELETE; fileOp.pFrom = "D:\\Documents and Settings\\Book1\\0\\0"; fileOp.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION; if (!SHFileOperation(&fileOp)) printf("it is DONE!"); else printf("Unwanted error happened!"); return 0; }