Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GetClipboardData() Cut vs. Copy

When GetClipboardData() is used to access the data captured by the Clipboard, is there an API call or flag to distinguish between a Copy action (CTRL+C) and a Cut action (CTRL+X)?

like image 267
Michael Haephrati Avatar asked Dec 06 '25 04:12

Michael Haephrati


1 Answers

There is no generic way to know if data was placed on the clipboard because of a cut or copy action. In most applications "cut" is just "copy selection"+"delete selection".

As noted in the comments, the shell has a clipboard format called CFSTR_PREFERREDDROPEFFECT but this format is mostly just used when "cutting" files/items in the shell. The shell calls this "delete on paste".

like image 99
Anders Avatar answered Dec 07 '25 18:12

Anders



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!