How to place several formats on the clipboard?

For example, what did Wordpad do when I press "Ctrl + C"? It puts many different formats on the clipboard. So Notepad can get text without any color or font ... etc., and you can still save the original format when you paste it into another Wordpad window.

MSDN said I have to call SetClipboardData repeatedly. But this does not work at all.

+6
c ++ windows clipboard delphi
source share
2 answers

You can use Delphi TClipboard.SetAsHandle to place data on the clipboard in any number of formats. Open the clipboard first, otherwise each SetAsHandle call will depend on what else was there, even in other formats.

 Clipboard.Open; Clipboard.SetAsHandle(cf_Text, x); Clipboard.SetAsHandle(cf_Bitmap, y); Clipboard.Close; 
+10
source share

All modern programs use OleSetClipboard to publish clipboard formats and data. Start reading here .

+3
source share

All Articles