In my Shell Namespace Extension I want to execute some action on the files that user has copied from it immediately after the copy process. It is a resource consuming process, so I would really prefer to first copy a file and only after that start processing it rather than present already processed items to the user.
Implementing a Drop Handler approach on Folder and Directory Classes works, but it appears to be too frustrating for end-user (to remember that items should be copied only with right-click drag-and-drop and not via Ctrl+C / Ctrl+V or any other mean).
So I am trying to find a way to execute this action right after "normal" copy.
Both IDataObject and ITransferSource interfaces do not provide any information about the destination of the data except for ITransferSource::MoveItem. I know it is done intentionally on the IDataObject since target could be whatever and the source should not know about it.
So for my specific task I think I need to find answers for following questions:
- Is it possible to know from within
IDataObject"who" is the receiver of the data: Explorer or any other application? I guess we can skip special Explorer-like cases like TotalCommander. - If it is somehow possible to know that Drop Target is an Explorer window - is it possible to know the destination folder?
- Is it possible to know if the copy process with
IDataObjectended successfully (except for tracking ifIStreamwas read till the very end)? - Is it possible to know the destination for the
ITransferSource::OpenItem? - Is it possible to know if the copy process with
ITransferSource::OpenItemended successfully?