EnumMetaFileProc callback function

The EnumMetaFileProc function is an application-defined callback function that processes Windows-format metafile records. This function is called by the EnumMetaFile function. The MFENUMPROC type defines a pointer to this callback function. EnumMetaFileProc is a placeholder for the application-defined function name.

Note  This function is provided only for compatibility with Windows-format metafiles. Enhanced-format metafiles provide superior functionality and are recommended for new applications. The corresponding function for an enhanced-format metafile is EnhMetaFileProc.



int CALLBACK EnumMetaFileProc(
  _In_ HDC         hDC,
  _In_ HANDLETABLE *lpHTable,
  _In_ int         nObj,
  _In_ LPARAM      lpClientData


  • hDC [in]
    Handle to the device context passed to EnumMetaFile.

  • lpHTable [in]
    Pointer to a table of handles associated with the graphics objects (pens, brushes, and so on) in the metafile.

  • lpMFR [in]
    Pointer to one of the records in the metafile. This record should not be modified. (If modification is necessary, it should be performed on a copy of the record.)

  • nObj [in]
    Specifies the number of objects with associated handles in the handle table.

  • lpClientData [in]
    Pointer to optional data.

Return value

This function must return a nonzero value to continue enumeration; to stop enumeration, it must return zero.


An application must register the callback function by passing its address to the EnumMetaFile function.

EnumMetaFileProc is a placeholder for the application-supplied function name.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Wingdi.h (include Windows.h)

See also

Metafiles Overview

Metafile Functions