|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| user32.lib
| Header File
| winuser.h
| Unicode
| No
| Platform Notes
| None
|
|
|
GetDCEx
The GetDCEx function retrieves the handle of a display device (DC) context for the
specified window. The display device context can be used in subsequent GDI functions
to draw in the client area.
This function is an extension to the GetDC function that gives an application more control over how and whether clipping
occurs in the client area.
HDC GetDCEx(
HWND hWnd,
| // handle of window
| HRGN hrgnClip,
| // handle of clip region
| DWORD flags
| // device-context creation flags
| );
|
|
Parameters
hWnd
Identifies the window where drawing will occur.
hrgnClip
Specifies a clipping region that may be combined with the visible region of
the client window.
flags
Specifies how the device context is created. This parameter can be a
combination of the following values:
Value
| Meaning
| DCX_WINDOW
| Returns a device context corresponding to the window rectangle rather than the
client rectangle.
| DCX_CACHE
| Returns a device context 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 device context 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 device context to the default attributes
when this device context 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 device context.
| DCX_INTERSECTRGN
| The clipping region identified by hrgnClip is intersected with the visible region of the returned device context.
| DCX_VALIDATE
| When specified with DCX_INTERSECTUPDATE, causes the device context to be
completely validated. Using this function with both DCX_INTERSECTUPDATE and
DCX_VALIDATE is identical to using the BeginPaint function.
|
Return Values
If the function succeeds, the return value is the handle of the device context
for the given window.
If the function fails, the return value is NULL. An invalid value for the hWnd parameter will cause the function to fail.
Remarks
Unless the display device context belongs to a window class, the ReleaseDC function must be called to release the device context after painting. Because
only five common device contexts are available at any given time, failure to
release a device context can prevent other applications from accessing a device
context.
A device context belonging to the window's class is returned by the GetDC function if CS_CLASSDC, CS_OWNDC or CS_PARENTDC was specified as a style in
the WNDCLASS structure when the class was registered.
See Also
BeginPaint, GetDC, GetWindowDC, ReleaseDC, WNDCLASS
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|