You mean a situation similar to delete-paste in Windows Explorer, where the file is not deleted from the source folder until the Insert operation occurs.
http://msdn.microsoft.com/en-us/library/bb776904(VS.85).aspx#delete_on_paste
Simple answer
If you do this in one instance of the application, this refers to the optimized movement , where you can simply set a local flag (for example, a boolean variable) to determine if it was successful.
Update:. Yes, you can also check the results of the DoDragDrop method to determine whether it was deleted. Just make sure your reset handling code correctly sets the Effect to None if there is an error that completes the crash, otherwise your DoDragDrop code will assume that the crash was successful. This method will work even between two instances of your application.
Hard answer
If you do this between two instances of your application, and you need to transfer more information about whether it was deleted or not, then you need to implement the OLE version of IDataObject
so that the application instance, this drop target completes the drag and drop, it can call SetData on the source object to send information about the results. This is difficult to do, but certainly possible.
For more information, see the following links:
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comtypes.idataobject.aspx
http://blogs.msdn.com/b/delay/archive/2009/10/26/creating-something-from-nothing-developer-friendly-virtual-file-implementation-for-net.aspx
source share