Metafile::GetHENHMETAFILE method

The Metafile::GetHENHMETAFILE method gets a Windows handle to an Enhanced Metafile (EMF) file.

Syntax

HENHMETAFILE GetHENHMETAFILE(

);

Parameters

This method has no parameters.

Return Value

Type: Type: HENHMETAFILE

This method returns a

					<b>HENHMETAFILE</b>.

Remarks

This method sets the

			<a href="https://docs.microsoft.com/windows/desktop/api/gdiplusheaders/nl-gdiplusheaders-metafile">Metafile</a> object to an invalid state. The user is responsible for calling DeleteEnhMetafile, to delete the Windows handle.

Examples

The following example creates a

					<a href="https://docs.microsoft.com/windows/desktop/api/gdiplusheaders/nl-gdiplusheaders-metafile">Metafile</a> object from an EMF+ file and gets a Windows handle to the metafile.
VOID Example_GetHENHMETAFILE(HDC hdc)
{

   // Create a GDI+ Metafile object from an existing disk file.
   Metafile metafile(L"SampleMetafile.emf+");

   // Get a Windows handle to the metafile.
   HENHMETAFILE hEmf = metafile.GetHENHMETAFILE();

}

Requirements

   
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See Also

ENHMETAHEADER3

Metafile