How to Undo SHFileOperation action from VB code?
Hello!
I'm currently working on project in which I need to implement some Shell Operations. I'm using SHFileOperation API with different constants and flags. We all know about this API that it allows us to perform any (?) shell operation with Undo facility. Like for example, we can have FO_DELETE with FOF_ALLOWUNDO to delete file to Recycle Bin.
Now, what I want to able to do is ... allow the user of Application to Undo Shell operation (which he will perform from my Application) from within my Application interface itself. I was wondering if there is any API or flag for SHFileOperation (like FO_UNDO) which will allow me to simulate the action performed by Windows Explorer when we click Edit - Undo <undoable_action_name> menu. Is there any?
If not a direct API then can anybody please let me know if there is any other method to Undo the Shell Operation? As far as Move, Copy and Rename actions are concerned; I will be able to keep the record in a Collection object and then revert the actions. But I'm finding difficulty in reverting the Delete action! And I think if there is a Flag FOF_ALLOWUNDO then it's quite logical to have some API method to undo Shell operation in one way or the other!
Waiting for your valuable reply ...
Thanks & Regards,
Ruturaj.
|