Hi all,
Is there any windows API that helps in restoring deleted files?
This is a discussion on Restoring deleted files within the Windows Programming forums, part of the Platform Specific Boards category; 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
Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.
I would start with the function
SHGetKnownFolderIDList (FOLDERID_RecycleBinFolder ...)
And see want can I do with the contents of the folder...
If I have eight hours for cutting wood, I spend six sharpening my axe.
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).