Microsoft Windows CE 3.0  

GetWindowDC

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.

This function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars.

HDC
GetWindowDC( HWND
hWnd
);

Parameters

hWnd
Handle to the window with a device context that is to be retrieved. If this value is NULL, GetWindowDCretrieves the device context for the entire screen.

Return Values

The handle of a device context for the specified window indicates success. NULL indicates an error or an invalid hWndparameter.

To get extended error information, call GetLastError.

Remarks

GetWindowDCis intended for special painting effects within a window's nonclient area. Painting in nonclient areas of any window is not recommended.

The GetSystemMetricsfunction can be used to retrieve the dimensions of various parts of the nonclient area, such as the title bar, menu, and scroll bars.

The GetDCfunction can be used to retrieve a device context for the entire screen.

After painting is complete, the ReleaseDCfunction must be called to release the device context. Not releasing the window device context has serious effects on painting requested by applications.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Coredll.lib, Winmgr.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

BeginPaint, GetDC, GetLastError, GetSystemMetrics, ReleaseDC