I put some data into clipboard , after I copied data from the clipboard, I want to clear the data without clearing the entire clipboard.
Something like that:
wchar_t* buf=NULL;
if( OpenClipboard(NULL)!=0)
{
HANDLE hData = GetClipboardData( CF_UNICODETEXT );
buf = (wchar_t*)GlobalLock( hData );
GlobalUnlock( hData );
CloseClipboard();
return buf;
}
//job is done, and now I want to clear only hData!
As far as I understand, EmptyClipboard() will empty everything!
Thanks in advance!
The clipboard only holds a single IDataObject
at one time; this data object can present multiple data formats but it is just a single COM object. The only way to do what you want would be to duplicate the existing data object (minus the format you wish to remove) and set that to the clipboard in place of the original.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With