views:

193

answers:

2

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.

+3  A: 

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

Hans Passant
+9  A: 

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;
Rob Kennedy
Thanks Rob, I have fixed this problem as you suggested. I'm using SetBuffer method of the TClipboard, the problem is that I open/close the clipboard for each call of SetBuffer.
trudger