When you cut/copy files from Windows Explorer, you can get that list of files through the Clipboard.GetFileDropList method.
How can you determine if that list came from a cut
or copy
operation or notify the other party that the cut/copy operation finished?
The other way around: you can put files to be cut or copied on the clipboard using the Clipboard.SetFileDropList method.
How can you specify that this list is to be copied or cut?
This is about a console application, so I cannot monitor the Windows WM_CUT
or WM_COPY
messages as suggested by C# Files - in clipboard How to set/read which operation is called - Cut or Copy
You need to get the value for the "Preferred DropEffect" format (see CFSTR_PREFERREDDROPEFFECT on MSDN). It contains a
STGMEDIUM
whosehGlobal
field points to a DWORD value. If this value isDROPEFFECT_COPY
, it's a copy operation; if it'sDROPEFFECT_MOVE
, it's a cut operation.