Class NativeHelper
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
GW_HWNDNEXT
public const uint GW_HWNDNEXT = 2
Field Value
HORZRES
public const int HORZRES = 8
Field Value
LOGPIXELSX
public const int LOGPIXELSX = 88
Field Value
MONITOR_DEFAULTTONEAREST
public const int MONITOR_DEFAULTTONEAREST = 2
Field Value
MONITOR_DEFAULTTOPRIMARY
public const int MONITOR_DEFAULTTOPRIMARY = 1
Field Value
VERTRES
public const int VERTRES = 10
Field Value
WM_LBUTTONDOWN
public const int WM_LBUTTONDOWN = 513
Field Value
WM_LBUTTONUP
public const int WM_LBUTTONUP = 514
Field Value
WM_MOUSEMOVE
public const int WM_MOUSEMOVE = 512
Field Value
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
nintA 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
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
nintThe 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
nintThe 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
nintA handle to the window whose DC is to be released.
hDC
nintA handle to the DC to be released.
Returns
- int
The return value indicates whether the DC was released.