The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GetEnhMetaFileDescription function

The GetEnhMetaFileDescription function retrieves an optional text description from an enhanced-format metafile and copies the string to the specified buffer.


UINT GetEnhMetaFileDescription(
  _In_  HENHMETAFILE hemf,
  _In_  UINT         cchBuffer,
  _Out_ LPTSTR       lpszDescription


hemf [in]

A handle to the enhanced metafile.

cchBuffer [in]

The size, in characters, of the buffer to receive the data. Only this many characters will be copied.

lpszDescription [out]

A pointer to a buffer that receives the optional text description.

Return value

If the optional text description exists and the buffer pointer is NULL, the return value is the length of the text string, in characters.

If the optional text description exists and the buffer pointer is a valid pointer, the return value is the number of characters copied into the buffer.

If the optional text description does not exist, the return value is zero.

If the function fails, the return value is GDI_ERROR.


The optional text description contains two strings, the first identifying the application that created the enhanced metafile and the second identifying the picture contained in the metafile. The strings are separated by a null character and terminated with two null charactersfor example, "XYZ Graphics Editor\0Bald Eagle\0\0" where \0 represents the null character.

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.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Wingdi.h (include Windows.h)





Unicode and ANSI names

GetEnhMetaFileDescriptionW (Unicode) and GetEnhMetaFileDescriptionA (ANSI)

See also

Metafiles Overview
Metafile Functions