Click here to Skip to main content
14,388,094 members
Rate this:
Please Sign up or sign in to vote.
See more:
I hook the IFileOperation COM interface,Copy, paste, delete, rename can be hook normally,I can get some log which I wanted, but when I drag and drop the files to recycle bin,DeleteItem and DeleteItems not be executed,MoveItem not be executed also,why? The question has bothered me for a long time,who can tell me the reason,What should I do.
sorry my english is very poorly
Updated 10-Nov-17 5:43am
Jochen Arndt 25-Dec-15 7:46am
A good question that deserves an upvote.

I don't have an answer but a possible explanation:

With drag & drop operations the drop target is responsible for performing the operation. This is the Windows Explorer for the trash bin. Moving a file to the trash bin is not a normal move (the original file information must be stored too). This process has been changed with Vista.

So all related operations are performed by the Windows Explorer and not by the system (ignoring the fact here that the Explorer is an essential part of the system). When the Explorer does not use the 'normal' system file operations but low level or system internal functions, you won't get them hooked.

Do you get a hook when deleting a file from within the Explorer?
Member 11562680 27-Dec-15 20:56pm
Thank you!
I can hook com interface IFileOption within the explorer,if i deleted a file,i can get the file path、the file type and so on information.
I don't know what should I do when I drag and drop files to the recycle bin

Jochen Arndt 28-Dec-15 4:20am
The trash folder is a special folder where files are not handled like within other folders (except when deleting them finally). When deleting a file, it is moved to the trash folder (in fact the sub folder of the user performing the delete) using a new hidden name and the original file information (name and path, dates, attributes) is stored in the meta data. These meta data are read by the Explorer to show the folder content.

But I still can't answer why the behaviour differs between normal delete and drag & drop.
0x01AA 25-Dec-15 9:13am
Can you observe the same while drag/drop in an other Folder than recycle bin?
Member 11562680 27-Dec-15 22:12pm
Thank you!
I can't observe the same while drag/drop in an other Folder than recycle bin
I can hook com interface IFileOption within the explorer

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

How you hook IFileOption and get the file name and path in copy, paste,drag and drop operation. Could you please share some of your codes? Thank you very much.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100