Table of Contents

Class NativeHelper

Namespace
Riverside.Toolkit.Helpers
Assembly
Riverside.Toolkit.dll

Provides helper methods for native interop.

public static class NativeHelper
Inheritance
NativeHelper
Inherited Members

Fields

GW_CHILD

public const uint GW_CHILD = 5

Field Value

uint

GW_HWNDNEXT

public const uint GW_HWNDNEXT = 2

Field Value

uint

HORZRES

public const int HORZRES = 8

Field Value

int

LOGPIXELSX

public const int LOGPIXELSX = 88

Field Value

int

MONITOR_DEFAULTTONEAREST

public const int MONITOR_DEFAULTTONEAREST = 2

Field Value

int

MONITOR_DEFAULTTOPRIMARY

public const int MONITOR_DEFAULTTOPRIMARY = 1

Field Value

int

VERTRES

public const int VERTRES = 10

Field Value

int

WM_LBUTTONDOWN

public const int WM_LBUTTONDOWN = 513

Field Value

int

WM_LBUTTONUP

public const int WM_LBUTTONUP = 514

Field Value

int

WM_MOUSEMOVE

public const int WM_MOUSEMOVE = 512

Field Value

int

Methods

GetDC(nint)

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

public static extern nint GetDC(nint hWnd)

Parameters

hWnd nint

A handle to the window whose DC is to be retrieved.

Returns

nint

The handle to the DC for the specified window's client area.

GetDeviceCaps(nint, int)

Retrieves device-specific information for the specified device.

public static extern int GetDeviceCaps(nint hdc, int nIndex)

Parameters

hdc nint

A handle to the DC.

nIndex int

The item to be returned.

Returns

int

The value of the specified item.

GetXFromLParam(nint)

Extracts the X-coordinate from the lParam parameter of a window message.

public static int GetXFromLParam(nint lParam)

Parameters

lParam nint

The lParam parameter of a window message.

Returns

int

The X-coordinate.

GetYFromLParam(nint)

Extracts the Y-coordinate from the lParam parameter of a window message.

public static int GetYFromLParam(nint lParam)

Parameters

lParam nint

The lParam parameter of a window message.

Returns

int

The Y-coordinate.

ReleaseDC(nint, nint)

Releases a device context (DC), freeing it for use by other applications.

public static extern int ReleaseDC(nint hWnd, nint hDC)

Parameters

hWnd nint

A handle to the window whose DC is to be released.

hDC nint

A handle to the DC to be released.

Returns

int

The return value indicates whether the DC was released.