For example, what Wordpad did when I press "Ctrl+C"? It places many different format to clipboard. So Notepad can get the text without any color or font...etc, and you still can keep the original format when you paste in another Wordpad window.
The MSDN said I should call SetClipboardData multiple times. But it doesn't work at all.
You can use Delphi's TClipboard.SetAsHandle
to put data on the clipboard in as many formats as you want. Open the clipboard first, or else each call to SetAsHandle
will clobber whatever else was already there, even in other formats.
Clipboard.Open;
Clipboard.SetAsHandle(cf_Text, x);
Clipboard.SetAsHandle(cf_Bitmap, y);
Clipboard.Close;
All modern programs use OleSetClipboard to publish clipboard formats and data. Start reading here.
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