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?...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    130

    Restoring deleted files

    Hi all,

    Is there any windows API that helps in restoring deleted files?

  2. #2
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    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.

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,470
    I would start with the function
    SHGetKnownFolderIDList (FOLDERID_RecycleBinFolder ...)
    And see want can I do with the contents of the folder...
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    130
    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.

  5. #5
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    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.");

  6. #6
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    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).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. Working with muliple source files
    By Swarvy in forum C++ Programming
    Replies: 1
    Last Post: 10-02-2008, 08:36 AM
  3. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM
  4. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  5. I deleted .cpp files. ARRGGHH
    By ihsir in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 03-13-2002, 11:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21