AnnSetMetafile example for Visual Basic
Private Declare Function GetObjectType Lib "gdi32" (ByVal hgdiobj As Long) As Long
Private Const OBJ_ENHMETAFILE = 13
Private Const OBJ_METAFILE = 9
Private Sub Metafile_Click()
Dim hMeta As OLE_HANDLE
Dim bEnh As Boolean
hMeta = LEAD1.AnnGetPredefinedMetafile (ANNMETAFILE_IMPORTANT, bEnh)
LEAD1.AnnSetPredefinedMetafile ANNMETAFILE_TOPSECRET, hMeta
LEAD1.AnnSetMetafile hStamp, 0, ANNMETAFILE_TOPSECRET, False
MsgBox "stamp set to TopSecret"
hMeta = LEAD1.AnnGetMetafile (hStamp)
Select Case GetObjectType(hMeta)
Case OBJ_ENHMETAFILE
MsgBox "Type is EMF"
Case OBJ_METAFILE
MsgBox "Type is WMF"
End Select
End Sub