BOOL DeleteMetaFile(hmf) | ||||
HMETAFILE hmf; | /* handle of metafile, */ |
The DeleteMetaFile function invalidates the given metafile handle.
hmf
Identifies the metafile to be deleted.
The return value is nonzero if the function is successful. Otherwise, it is zero.
The DeleteMetaFile function does not destroy a metafile that is saved on disk. After calling DeleteMetaFile, an application can retrieve a new handle of the metafile by calling the GetMetaFile function.
The following example uses the CreateMetaFile function to create the handle of a memory metafile device context, draws a line in that device context, retrieves a handle of the metafile by calling the CloseMetaFile function, plays the metafile by using the PlayMetaFile function, and finally deletes the metafile by using DeleteMetaFile:
HDC hdcMeta;
HMETAFILE hmf;
hdcMeta = CreateMetaFile(NULL);
MoveTo(hdcMeta, 10, 10);
LineTo(hdcMeta, 100, 100);
hmf = CloseMetaFile(hdcMeta);
PlayMetaFile(hdc, hmf);
DeleteMetaFile(hmf);