SHARE
TWEET

Get current clipboard formats...

a guest Sep 4th, 2012 94 Never
  1. uses
  2.   ActiveX;
  3.  
  4. procedure TForm1.Button1Click(Sender: TObject);
  5. var
  6.   S: string;
  7.   FormatEtc: TFormatEtc;
  8.   DataObject: IDataObject;
  9.   EnumFormatEtc: IEnumFormatEtc;
  10. begin
  11.   S := '';
  12.   if Succeeded(OleGetClipboard(DataObject)) then
  13.   begin
  14.     if Succeeded(DataObject.EnumFormatEtc(DATADIR_GET, EnumFormatEtc)) then
  15.       while EnumFormatEtc.Next(1, FormatEtc, nil) = S_OK do
  16.         S := S + IntToStr(FormatEtc.cfFormat) + sLineBreak;
  17.     ShowMessage(S);
  18.   end;
  19. end;
RAW Paste Data
Top