Retrieves the handle of a device context for the CWnd window.
CDC* GetDCEx( CRgn* prgnClip, DWORD flags );
- Identifies a clipping region that may be combined with the visible region of the client window.
- Can have one of the following preset values:
- DCX_CACHE Returns a device context from the cache rather than the OWNDC or CLASSDC window. Overrides CS_OWNDC and CS_CLASSDC.
- DCX_CLIPCHILDREN Excludes the visible regions of all child windows below the CWnd window.
- DCX_CLIPSIBLINGS Excludes the visible regions of all sibling windows above the CWnd window.
- DCX_EXCLUDERGN Excludes the clipping region identified by prgnClip from the visible region of the returned device context.
- DCX_INTERSECTRGN Intersects the clipping region identified by prgnClip within the visible region of the returned device context.
- DCX_LOCKWINDOWUPDATE Allows drawing even if there is a LockWindowUpdate call in effect that would otherwise exclude this window. This value is used for drawing during tracking.
- DCX_PARENTCLIP Uses the visible region of the parent window and ignores the parent window's WS_CLIPCHILDREN and WS_PARENTDC style bits. This value sets the device context's origin to the upper-left corner of the CWnd window.
- DCX_WINDOW Returns a device context that corresponds to the window rectangle rather than the client rectangle.
The device context for the specified window if the function is successful; otherwise NULL.
The device context can be used in subsequent GDI functions to draw in the client area.
This function, which is an extension to the GetDC function, gives an application more control over how and whether a device context for a window is clipped.
Unless the device context belongs to a window class, the ReleaseDC function must be called to release the context after drawing. Since only five common device contexts are available at any given time, failure to release a device context can prevent other applications from gaining access to a device context.
A device context with special characteristics is returned by the GetDCEx function if the CS_CLASSDC, CS_OWNDC, or CS_PARENTDC style was specified in the WNDCLASS structure when the class was registered.
For more information about these characteristics, see the description of the WNDCLASS structure in the Platform SDK.