GetEnhMetaFile

The GetEnhMetaFile function creates a handle that identifies the enhanced-format metafile stored in the specified file.

HENHMETAFILE GetEnhMetaFile(
  LPCTSTR lpszMetaFile   // pointer to metafile name
);
 

Parameters

lpszMetaFile
Pointer to the null-terminated string that specifies the name of an enhanced metafile.

Return Values

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

If the function fails, the return value is NULL.

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

Remarks

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

A Windows-format metafile must be converted to the enhanced format before it can be processed by the GetEnhMetaFile function. To convert the file, use the SetWinMetaFileBits function.

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

Windows 95 and Windows 98: The maximum length of the description string for an enhanced metafile is 16,384 bytes.

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, GetEnhMetaFile, SetWinMetaFileBits