Table of Contents

Method GetDC

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetDC(nint)

Retrieves a handle to the device context (DC) for the specified window or for the entire screen.

public static extern nint GetDC(nint hwnd)

Parameters

hwnd nint

A handle to the window whose device context is to be retrieved. If this parameter is Zero, the device context for the entire screen is retrieved.

Returns

nint

A handle to the device context for the specified window or screen. If the function fails, the return value is Zero.

Remarks

The device context can be used in subsequent GDI (Graphics Device Interface) operations. After finishing with the device context, the caller must release it by calling the ReleaseDC function.