GetEnhMetaFileHeader

The GetEnhMetaFileHeader function retrieves the record containing the header for the specified enhanced-format metafile.

UINT GetEnhMetaFileHeader(
  HENHMETAFILE hemf,      // handle to enhanced metafile
  UINT cbBuffer,          // size of buffer, in bytes
  LPENHMETAHEADER lpemh   // pointer to the buffer to receive data
);
 

Parameters

hemf
Handle to the enhanced metafile for which the header is to be retrieved.
cbBuffer
Specifies the size, in bytes, of the buffer to receive the data. Only this many bytes will be copied.
lpemh
Pointer to an ENHMETAHEADER structure to receive the header record. If this parameter is NULL, the function returns the size of the header record.

Return Values

If the function succeeds and the structure pointer is NULL, the return value is the size of the record that contains the header; if the structure pointer is a valid pointer, the return value is the number of bytes copied. Otherwise, it is zero.

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

Remarks

An enhanced-metafile header contains such information as the metafile's size, in bytes; the dimensions of the picture stored in the metafile; the number of records stored in the metafile; the offset to the optional text description; the size of the optional palette, and the resolution of the device on which the picture was created.

The record that contains the enhanced-metafile header is always the first record in the metafile.

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.

See Also

Metafiles Overview, Metafile Functions, ENHMETAHEADER, PlayEnhMetaFile