ReleaseDC

Syntax

int ReleaseDC(hWnd,hDC)

This function releases a device context, freeing it for use by other applications. The effect of the ReleaseDC function depends on the device-context type. It only frees common and window device contexts. It has no effect on class or private device contexts.

Parameter Type/Description  

hWnd HWND Identifies the window whose device context is to be released.  
hDC HDC Identifies the device context to be released.  

Return Value

The return value specifies whether the device context is released. It is 1 if the device context is released. Otherwise, it is zero.

Comments

The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common device context.