DeleteDC

The DeleteDC function deletes the specified device context (DC).

BOOL DeleteDC(
  HDC hdc   // handle to device context
);
 

Parameters

hdc
Handle to the device context.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT: To get extended error information, call GetLastError.

Remarks

An application must not delete a device context whose handle was obtained by calling the GetDC function. Instead, it must call the ReleaseDC function to free the device context.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.

See Also

Device Contexts Overview, Device Context Functions, CreateDC, GetDC, ReleaseDC