This GDI class library was written and placed in the Public Domain in 2005 by Dirk Busch
:class gdiWindowDC <super gdiDC
Window device context class
:M Release: ( -- )
The Release: method releases a device context (DC), freeing it for use by other applications. The effect of the ReleaseDC function depends on the type of DC. It frees only common and window DCs. It has no effect on class or private DCs.
:M GetDC: ( hWnd -- f )
The GetDC method retrieves a handle to a display device context for the client area of a specified window.
:M GetDCEx: ( hrgnClip flags hWnd -- f )
The GetDCEx method retrieves a handle to a display device context for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC.
This function is an extension to the GetDC function, which gives an application more control over how and whether clipping occurs in the client area.
hrgnClip Specifies a clipping region that may be combined with the visible region of the DC. If the value of flags is DCX_INTERSECTRGN or DCX_EXCLUDERGN, then the operating system assumes ownership of the region and will automatically delete it when it is no longer needed. In this case, applications should not use the region not even delete it after a successful call to GetDCEx.
flags Specifies how the DC is created. This parameter can be one or more of the following values.
DCX_WINDOW Returns a DC that corresponds to the window rectangle rather than the client rectangle.
DCX_CACHE Returns a DC from the cache, rather than the OWNDC or CLASSDC window. Essentially overrides CS_OWNDC and CS_CLASSDC.
DCX_PARENTCLIP Uses the visible region of the parent window. The parent's WS_CLIPCHILDREN and CS_PARENTDC style bits are ignored. The origin is set to the upper-left corner of the window identified by hWnd.
DCX_CLIPSIBLINGS Excludes the visible regions of all sibling windows above the window identified by hWnd.
DCX_CLIPCHILDREN Excludes the visible regions of all child windows below the window identified by hWnd.
DCX_NORESETATTRS Does not reset the attributes of this DC to the default attributes when this DC is released.
DCX_LOCKWINDOWUPDATE Allows drawing even if there is a LockWindowUpdate call in effect that would otherwise exclude this window. Used for drawing during tracking.
DCX_EXCLUDERGN The clipping region identified by hrgnClip is excluded from the visible region of the returned DC.
DCX_INTERSECTRGN The clipping region identified by hrgnClip is intersected with the visible region of the returned DC.
DCX_VALIDATE When specified with DCX_INTERSECTUPDATE, causes the DC to be completely validated. Using this function with both DCX_INTERSECTUPDATE and DCX_VALIDATE is identical to using the BeginPaint function.
:M GetWindowDC: ( hWnd -- f )
The GetWindowDC method retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.
:M GetDCOrg: ( -- x y )
The GetDCOrgEx function retrieves the final translation origin for a specified device context (DC). The final translation origin specifies an offset that the system uses to translate device coordinates into client coordinates (for coordinates in an application's window).
;class
End of gdiWindowDC class
Document $Id: gdiWindowDc.htm,v 1.12 2007/05/26 10:24:13 dbu_de Exp $