[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Design.Advanced.DesignerForm.GetDCEx

GetDCEx Method

GetDCEx(IntPtr, IntPtr, int)

Retrieves a handle to a device context (DC) 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.

Declaration
public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hRgn, int flags)
Parameters
Type Name Description
IntPtr hWnd

A handle to the window whose DC is to be retrieved. If this value is NULL, GetDCEx retrieves the DC for the entire screen.

IntPtr hRgn

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. Therefore, application should not reference the region after a successful call to GetDCEx using one of these flags. If hRgn is NULL, the clipping region is ignored.

int flags

Specifies how the DC is created. This parameter can be one or more of the DCX_ values.

Returns
Type Description
IntPtr

If the function succeeds, the return value is the handle to the DC for the specified window's client area. If the function fails, the return value is NULL.

Remarks
<p>After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. 

ReleaseDC must be called from the same thread that called GetDCEx. The number of DCs is limited only by available memory.

Note that the function is an imported function from the User32.dll library and is utilized within managed code through platform invocation services (P/Invoke).