Im Clipboard können mehrere Formate gespeichert werden, daher mußt Du überprüfen, ob
auch eine Textversion verfügbar ist.
Delphi-Quellcode:
uses
ClipBrd;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if Clipboard.HasFormat(CF_TEXT) then
ShowMessage('text version verfügbar');
end;
Die offiziellen Formate (ja, man kann auch eigene definieren):
Delphi-Quellcode:
const
{ Predefined Clipboard Formats }
{$EXTERNALSYM CF_TEXT}
CF_TEXT = 1;
{$EXTERNALSYM CF_BITMAP}
CF_BITMAP = 2;
{$EXTERNALSYM CF_METAFILEPICT}
CF_METAFILEPICT = 3;
{$EXTERNALSYM CF_SYLK}
CF_SYLK = 4;
{$EXTERNALSYM CF_DIF}
CF_DIF = 5;
{$EXTERNALSYM CF_TIFF}
CF_TIFF = 6;
{$EXTERNALSYM CF_OEMTEXT}
CF_OEMTEXT = 7;
{$EXTERNALSYM CF_DIB}
CF_DIB = 8;
{$EXTERNALSYM CF_PALETTE}
CF_PALETTE = 9;
{$EXTERNALSYM CF_PENDATA}
CF_PENDATA = 10;
{$EXTERNALSYM CF_RIFF}
CF_RIFF = 11;
{$EXTERNALSYM CF_WAVE}
CF_WAVE = 12;
{$EXTERNALSYM CF_UNICODETEXT}
CF_UNICODETEXT = 13;
{$EXTERNALSYM CF_ENHMETAFILE}
CF_ENHMETAFILE = 14;
{$EXTERNALSYM CF_HDROP}
CF_HDROP = 15;
{$EXTERNALSYM CF_LOCALE}
CF_LOCALE = $10;
{$EXTERNALSYM CF_MAX}
CF_MAX = 17;
{$EXTERNALSYM CF_DIBV5}
CF_DIBV5 = 17;
{$EXTERNALSYM CF_MAX_XP}
CF_MAX_XP = 18;
{ Note:CF_MAX changes values if WINVER < 5. In order to maintain
backwards compatability, use CF_MAX for WINVER < 5, and CF_MAX_XP for
WINVER > 5. }
{$EXTERNALSYM CF_OWNERDISPLAY}
CF_OWNERDISPLAY = 128;
{$EXTERNALSYM CF_DSPTEXT}
CF_DSPTEXT = 129;
{$EXTERNALSYM CF_DSPBITMAP}
CF_DSPBITMAP = 130;
{$EXTERNALSYM CF_DSPMETAFILEPICT}
CF_DSPMETAFILEPICT = 131;
{$EXTERNALSYM CF_DSPENHMETAFILE}
CF_DSPENHMETAFILE = 142;
{ "Private" formats don't get GlobalFree()'d }
{$EXTERNALSYM CF_PRIVATEFIRST}
CF_PRIVATEFIRST = $200;
{$EXTERNALSYM CF_PRIVATELAST}
CF_PRIVATELAST = 767;
{ "GDIOBJ" formats do get DeleteObject()'d }
{$EXTERNALSYM CF_GDIOBJFIRST}
CF_GDIOBJFIRST = 768;
{$EXTERNALSYM CF_GDIOBJLAST}
CF_GDIOBJLAST = 1023;
...
...