PlayMetaFileRecord function (wingdi.h)

The PlayMetaFileRecord function plays a Windows-format metafile record by executing the graphics device interface (GDI) function contained within that record.

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 PlayEnhMetaFileRecord.


BOOL PlayMetaFileRecord(
  [in] HDC           hdc,
  [in] LPHANDLETABLE lpHandleTable,
  [in] UINT          noObjs


[in] hdc

A handle to a device context.

[in] lpHandleTable

A pointer to a HANDLETABLE structure representing the table of handles to GDI objects used when playing the metafile.

[in] lpMR

A pointer to the Windows-format metafile record.

[in] noObjs

The number of handles in the handle table.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.


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

An application typically uses PlayMetaFileRecord in conjunction with the EnumMetaFile function to process and play a Windows-format metafile one record at a time.

The lpHandletable and nHandles parameters must be identical to those passed to the EnumMetaFileProc callback procedure by EnumMetaFile.

If the PlayMetaFileRecord function does not recognize a record, it ignores the record and returns TRUE.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also




Metafile Functions

Metafiles Overview