BOOL EnumEnhMetaFile(hdc, hemf, lpEnhMetaFunc, lpData, lpRect) | |||||
HDC hdc; | /* handle of a device context | */ | |||
HENHMETAFILE hemf; | /* handle of an enhanced metafile | */ | |||
PROC lpEnhMetaFunc; | /* address of a callback function | */ | |||
LPVOID lpData; | /* address of callback-function data | */ | |||
LPRECT lpRect; | /* address of a picture's bounding rectangle | */ |
The EnumEnhMetaFile function enumerates the records within the enhanced metafile identified by hemf by retrieving each record and passing it to the callback function identified by lpEnhMetaFunc.
hdc
Identifies a device context. This handle is passed to the callback function.
hemf
Identifies the enhanced metafile.
lpEnhMetaFunc
Points to the application-supplied callback function.
lpData
Points to optional callback-function data.
lpRect
Points to a RECT structure that specifies the coordinates of the picture's upper-left and lower-right corners. The dimensions of this rectangle are specified in logical units.
The return value is TRUE if the callback function enumerates all the records in the enhanced metafile. Otherwise, it is FALSE.
Points along the edge of the rectangle at which lpRect points are included in the picture. If hdc is NULL, Windows ignores lpRect.
If the callback function calls the PlayEnhMetaFile function, hdc must identify a valid device context. (Windows uses the device context's transformation and mapping mode to transform the picture that is displayed by the PlayEnhMetaFile function. If hdc is NULL, the picture will not be transformed and may appear distored.)
Applications can use the EnumEnhMetaFile function to embed one enhanced metafile within another.
BOOL WINAPI EnhMetaFunc(hdc, lpHandletable, lpEnhMetaRecord,
nHandles, lpData)
HDC hdc;
LPHANDLETABLE lpHandletable;
LPENHMETARECORD lpEnhMetaRecord;
UINT nHandles;
LPVOID lpData;
This function may have any name, EnhMetaFunc is just an example.
hdc
Identifies the device context that was passed to EnumEnhMetaFile.
lpHandletable
Points to a table of handles associated with the objects (pens, brushes, and so on) in the enhanced metafile. The first entry contains the enhanced metafile handle.
lpEnhMetaRecord
Points to a metafile record contained in the enhanced metafile. The record should not be modified. If modification is needed, it should be made on a copy of this record.
nHandles
Specifies the number of handles in the handle table.
lpData
Points to the application-supplied data.
The function can carry out any desired task. It must return TRUE to continue enumeration, or FALSE to stop it.
PlayEnhMetaFile, PlayEnhMetaFileRecord