Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Get current clipboard formats...

By: a guest on Sep 4th, 2012  |  syntax: Delphi  |  size: 0.47 KB  |  views: 69  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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;