This example calls DevCloseDC to close a device context based on the handle returned from DevOpenDC.
#define INCL_DEV /* Device Function definitions */ #include <os2.h> HDC hdc; /* Device-context handle */ HMF hmf; /* error code (or metafile handle if metafile device context) */ /* close the device context associated with handle hdc */ hmf = DevCloseDC(hdc);