I have a WinForms application with TreeView. The user can drag and drop files from WindowsExplorer to TreeView, and then they can drag and drop files back to WindowsExplorer, which affects copies of files anywhere where files were deleted. I try to do this if the files already exist in the directory where the files are deleted, I want to rename the files / folders copied in advance so that there is no collision.
This is how I copy files to WindowsExplorer. In the treeView ItemDrag, I go through the nodes of the selected node and then pack it into an array. Then I use this code:
var dataObject = new DataObject(DataFormats.FileDrop, files.ToArray()); dataObject.SetData(DataFormats.StringFormat, dataObject); DoDragDrop(dataObject, DragDropEffects.Copy);
This works well, but as soon as it goes to Windows Explorer, it is out of my hands. How do I know when and where files are copied to, and intercept them to make changes? Is it possible?
source share