An application can store a metafile in system memory or in a disk file.
To store the metafile in memory, an application calls the CreateMetaFile function and passes NULL as the function parameter. The application can free the memory that Windows uses to store the metafile by calling the DeleteMetaFile function. This function removes a metafile from memory and invalidates its handle. DeleteMetaFile has no effect on disk files.
There are two ways of storing a metafile in a disk file:
When the application calls the CreateMetaFile function to open a metafile, it passes a filename as the function parameter; the metafile is then recorded in a disk file.
After the application has created a metafile in memory, it calls the CopyMetaFile function. This function accepts the handle of a memory metafile and the name of the disk file to which the metafile will be saved.
The GetMetaFile function opens a metafile stored in a disk file and makes it available for replay or modification. This function accepts the filename of a metafile stored on disk and returns a metafile handle.