Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function releases a device context (DC), freeing it for use by other applications. The effect of ReleaseDCdepends on the type of device context.

Syntax

int ReleaseDC( 
  HWND 
hWnd, 
  HDC 
hDC
);

Parameters

hWnd

Handle to the window whose device context is to be released.

hDC

Handle to the device context to be released.

Return Value

The return value specifies whether the device context is released.

1 indicates that the device context is released.

Zero indicates that the device context is not released.

Remarks

The application must call the ReleaseDCfunction for each call to the GetWindowDCfunction and for each call to the GetDCfunction that retrieves a common device context.

An application cannot use the ReleaseDCfunction to release a device context that was created by calling the CreateDCfunction; instead, it must use the DeleteDCfunction.

Requirements

Header winuser.h
Library coredll.lib, Winmgr.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also