CopyEnhMetaFile

The CopyEnhMetaFile function copies the contents of an enhanced-format metafile to a specified file.

HENHMETAFILE CopyEnhMetaFile(
  HENHMETAFILE hemfSrc,  // handle to an enhanced metafile
  LPCTSTR lpszFile       // pointer to a filename string
);
 

Parameters

hemfSrc
Handle to the source-enhanced metafile.
lpszFile
Pointer to the name of the destination file. If this parameter is NULL, the source metafile is copied to memory.

Return Values

If the function succeeds, the return value is a handle to the copy of the enhanced metafile.

If the function fails, the return value is NULL.

Windows NT: To get extended error information, call GetLastError.

Remarks

Where text arguments must use Unicode characters, use the CopyEnhMetaFile function as a wide-character function. Where text arguments must use characters from the Windows character set, use this function as an ANSI function.

Applications can use metafiles stored in memory for temporary operations.

When the application no longer needs the enhanced-metafile handle, it should delete the handle by calling the DeleteEnhMetaFile function.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Metafiles Overview, Metafile Functions, DeleteEnhMetaFile