AnnSetMetafile example for Visual C++ 4.0 and later
long hStamp;
HMETAFILE hMeta;
BOOL bEnh;
hMeta = (HMETAFILE)m_Lead1.AnnGetPredefinedMetafile (ANNMETAFILE_IMPORTANT, &bEnh);
m_Lead1.AnnSetPredefinedMetafile (ANNMETAFILE_TOPSECRET, (OLE_HANDLE)hMeta);
m_Lead1.AnnSetMetafile (hStamp, 0, ANNMETAFILE_TOPSECRET, FALSE);
AfxMessageBox("stamp set to TopSecret");
hMeta = (HMETAFILE)m_Lead1.AnnGetMetafile (hStamp);
switch(::GetObjectType(hMeta))
{
case OBJ_ENHMETAFILE:
AfxMessageBox("Type is EMF");
case OBJ_METAFILE:
AfxMessageBox("Type is WMF");
}