EnumMetaFile

The EnumMetaFile function enumerates the records within a Windows-format metafile by retrieving each record and passing it to the specified callback function. The application-supplied callback function processes each record as required. The enumeration continues until the last record is processed or when the callback function returns zero.

Note  This function is provided for compatibility with 16-bit versions of Windows. Win32-based applications should use the EnumEnhMetaFile function.

BOOL EnumMetaFile(
  HDC hdc,                // handle to device context
  HMETAFILE hmf,          // handle to Windows-format metafile
  MFENUMPROC lpMetaFunc,  // pointer to callback function
  LPARAM lParam           // address of callback function data
);
 

Parameters

hdc
Handle to a device context. This handle is passed to the callback function.
hmf
Handle to a Windows-format metafile.
lpMetaFunc
Pointer to an application-supplied callback function. For more information, see EnumMetaFileProc.
lParam
Pointer to optional callback-function data.

Return Values

If the callback function successfully enumerates all the records in the Windows-format metafile, the return value is nonzero.

If the callback function does not successfully enumerate all the records in the Windows-format metafile, the return value is zero.

Remarks

A Windows-format metafile does not support the new curve, path, and transformation functions, such as PolyBezier, BeginPath, and SetWorldTransform. Applications that use these new functions and use metafiles to store pictures created by these functions should use the enhanced-format metafile functions.

To convert a Windows-format metafile into an enhanced-format metafile, use the SetWinMetaFileBits function.

You can use the EnumMetaFile function to embed one Windows-format metafile within another.

See Also

Metafiles Overview, Metafile Functions, BeginPath, EnumEnhMetaFile, EnumMetaFileProc, PlayMetaFile, PlayMetaFileRecord, PolyBezier, SetWinMetaFileBits, SetWorldTransform