ReleaseDC

2.x

  int ReleaseDC(hwnd, hdc)    
  HWND hwnd; /* handle of window with device context */
  HDC hdc; /* handle of device context */

The ReleaseDC function releases the given device context, freeing it for use by other applications.

Parameters

hwnd

Identifies the window whose device context is to be released.

hdc

Identifies the device context to be released.

Return Value

The return value is 1 if the function is successful. Otherwise, it is 0.

Comments

The effect of ReleaseDC depends on the type of device context. It frees only common and window device contexts. It has no effect on class or private device contexts.

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.

See Also

BeginPaint, EndPaint, GetDC, GetWindowDC