Is there ICopyHook.CopyCallback for files or alternative for it?
we use ICopyHook.CopyCallback shell extension to detect deletion , moving ,creation of folders , but not files Link , How to detect if the user is deleting a file from C# Application , or How to handle the delete operation for the user ? example : the user press Shift + DEL on f1.txt, then the operating System asks "Are Yuo sure You Want to delete 'f1.txt'? , if the user press 'yes' then the C# application will handle the deletion operation by moving 'f1.txt' to some hidden folder {for example } in transparent way ???
note : I think FileSystemWatcher开发者_运维问答 can NOT do this task ..
You need a file system filter driver, which will intercept requests for file deletion or file moving (the file is moved to recycle bin) and will act accordingly.
Note, that as there's no such operation as copying a file on file system level (ICopyHook can catch only operations carried by Explorer itself or via shell API functions), you won't be able to track "copying" using file system filter driver (or by any other means).
精彩评论