AnnSetMetafile example for C++ Builder

void TForm1::TestMetaFile(HANNOBJECT hStamp)
{
   HMETAFILE hMeta;
   bool bEnhanced;

   LEADAnn1->AnnGetPredefinedMetafile(ANNMETAFILE_IMPORTANT, bEnhanced, (unsigned int)hMeta);
   LEADAnn1->AnnSetPredefinedMetafile(ANNMETAFILE_TOPSECRET, (unsigned int)hMeta);
   LEADAnn1->AnnSetMetafile(hStamp, 0, ANNMETAFILE_TOPSECRET, False);
   ShowMessage("Stamp set to TopSecret");

   LEADAnn1->AnnGetMetafile(hStamp, (unsigned int)hMeta);
   switch (GetObjectType(hMeta))
   {
      case OBJ_ENHMETAFILE:
         ShowMessage("Type is EMF");
      break;

      case OBJ_METAFILE:
         ShowMessage("Type is WMF");
      break;
   }
}