/*
SaveToClipboardFormat, SetAsHandle example
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  int DataHandle;
  HPALETTE APalette;
  unsigned short MyFormat;
  Graphics::TBitmap *Bitmap = new Graphics::TBitmap();
  try
  {
    Bitmap->LoadFromFile("C:\\Program  Files\\Common Files\\Borland Shared\\Images\\Splash\\256color\\factory.bmp ");
    // generate a clipboard format, with data and palette
    Bitmap->SaveToClipboardFormat(MyFormat,DataHandle,APalette);
    // save the data to the clipboard using that format and
    // the generated data
    Clipboard()->SetAsHandle(MyFormat,DataHandle);
  }
  catch (...)
  {
     ShowMessage("Failed to copy image to clipboard!");
  }
  delete Bitmap;
} 
