Hi all,
Is there any windows API that helps in restoring deleted files?
Hi all,
Is there any windows API that helps in restoring deleted files?
calling a shell command to 'undelete' them ? other than that I didnt find anything but a callback function for notification when a fiel was being undeleted - UndeleteFile
I would start with the function
SHGetKnownFolderIDList (FOLDERID_RecycleBinFolder ...)
And see want can I do with the contents of the folder...
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Can anybody provide me with some examples of using:
1. SHGetKnownFolderIDList
2. UnDeleteFile
I have read the documentation and I think for any newbie in win-programming it will not be enough.
I just threw this together, nothing fancy, and not tested...
Code:// Stuff... #define Report(x) MessageBox(NULL,x,"Report:",MB_ICONINFORMATION|MB_OK) char szPath[260]; strcpy(szPath, "C:\\test.txt"); // Delete file... if(0 != DeleteFile(szPath)) Report("File deleted."); else Report("Deletation of file failed."); // Restore file... if(IDOK == UndeleteFile(szPath)) Report("File undeleted."); else Report("Restoration of file failed.");
uh... did you even look at the posts above/MSDN?
As Abach said, it is a callback function for the File Manager and has two arguments (none of which are "szPath" or anything even remotely close to what you suggested above).