PlayMetaFile function (wingdi.h)

The PlayMetaFile function displays the picture stored in the given Windows-format metafile on the specified device.

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

Syntax

BOOL PlayMetaFile(
  [in] HDC       hdc,
  [in] HMETAFILE hmf
);

Parameters

[in] hdc

Handle to a device context.

[in] hmf

Handle to a Windows-format metafile.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

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

A Windows-format metafile can be played multiple times.

A Windows-format metafile can be embedded in a second Windows-format metafile by calling the PlayMetaFile function and playing the source metafile into the device context for the target metafile.

Any object created but not deleted in the Windows-format metafile is deleted by this function.

To stop this function, an application can call the CancelDC function from another thread to terminate the operation. In this case, the function returns FALSE.

Requirements

Requirement Value
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

CancelDC

Metafile Functions

Metafiles Overview

SetWinMetaFileBits