Table of Contents

Class User32

Namespace
Xui.Runtime.Windows.Win32
Assembly
Xui.Runtime.Windows.dll
public static class User32
Inheritance
User32
Inherited Members

Fields

Lib

public static readonly nint Lib

Field Value

nint

User32Lib

public const string User32Lib = "user32.dll"

Field Value

string

Methods

CreateWindowEx(uint, ushort, string, uint, int, int, int, int, HWND, nint, nint, nint)

public static nint CreateWindowEx(uint dwExStyle, ushort atom, string lpWindowName, uint dwStyle, int X, int Y, int nWidth, int nHeight, User32.Types.HWND hWndParent, nint hMenu, nint hInstance, nint lpParam)

Parameters

dwExStyle uint
atom ushort
lpWindowName string
dwStyle uint
X int
Y int
nWidth int
nHeight int
hWndParent User32.Types.HWND
hMenu nint
hInstance nint
lpParam nint

Returns

nint

DestroyWindow(HWND)

public static bool DestroyWindow(User32.Types.HWND hWnd)

Parameters

hWnd User32.Types.HWND

Returns

bool

DispatchMessage(ref MSG)

public static nint DispatchMessage(ref User32.MSG msg)

Parameters

msg User32.MSG

Returns

nint

GetDpiForSystem()

public static extern uint GetDpiForSystem()

Returns

uint

GetKeyState(int)

public static extern short GetKeyState(int nVirtKey)

Parameters

nVirtKey int

Returns

short

GetMessage(ref MSG, HWND, uint, uint)

public static bool GetMessage(ref User32.MSG msg, User32.Types.HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax)

Parameters

msg User32.MSG
hWnd User32.Types.HWND
wMsgFilterMin uint
wMsgFilterMax uint

Returns

bool

GetSysColorBrush(int)

public static extern nint GetSysColorBrush(int nIndex)

Parameters

nIndex int

Returns

nint

GetSystemMetrics(SystemMetric)

public static extern int GetSystemMetrics(User32.SystemMetric nIndex)

Parameters

nIndex User32.SystemMetric

Returns

int

GetSystemMetricsForDpi(SystemMetric, uint)

public static extern int GetSystemMetricsForDpi(User32.SystemMetric nIndex, uint dpi)

Parameters

nIndex User32.SystemMetric
dpi uint

Returns

int

LoadCursor(nint, int)

public static nint LoadCursor(nint hInstance, int lpCursorName)

Parameters

hInstance nint
lpCursorName int

Returns

nint

MsgWaitForMultipleObjectsEx(uint, nint[]?, uint, uint, uint)

public static uint MsgWaitForMultipleObjectsEx(uint nCount, nint[]? pHandles, uint dwMilliseconds, uint dwWakeMask, uint dwFlags)

Parameters

nCount uint
pHandles nint[]
dwMilliseconds uint
dwWakeMask uint
dwFlags uint

Returns

uint

PeekMessage(ref MSG, HWND, uint, uint, uint)

public static bool PeekMessage(ref User32.MSG msg, User32.Types.HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg)

Parameters

msg User32.MSG
hWnd User32.Types.HWND
wMsgFilterMin uint
wMsgFilterMax uint
wRemoveMsg uint

Returns

bool

PostMessage(HWND, WindowMessage, WPARAM, LPARAM)

public static bool PostMessage(User32.Types.HWND hWnd, User32.WindowMessage Msg, Types.WPARAM wParam, Types.LPARAM lParam)

Parameters

hWnd User32.Types.HWND
Msg User32.WindowMessage
wParam Types.WPARAM
lParam Types.LPARAM

Returns

bool

PostQuitMessage(int)

public static extern void PostQuitMessage(int nExitCode)

Parameters

nExitCode int

PostThreadMessage(uint, uint, nuint, nint)

public static bool PostThreadMessage(uint idThread, uint Msg, nuint wParam, nint lParam)

Parameters

idThread uint
Msg uint
wParam nuint
lParam nint

Returns

bool

RegisterClassEx(WNDCLASSEXW)

public static extern ushort RegisterClassEx(User32.WNDCLASSEXW p)

Parameters

p User32.WNDCLASSEXW

Returns

ushort

SendMessage(HWND, uint, nuint, nint)

public static extern nint SendMessage(User32.Types.HWND hWnd, uint Msg, nuint wParam, nint lParam)

Parameters

hWnd User32.Types.HWND
Msg uint
wParam nuint
lParam nint

Returns

nint

SetCursor(nint)

public static extern nint SetCursor(nint hCursor)

Parameters

hCursor nint

Returns

nint

SetLayeredWindowAttributes(HWND, COLORREF, byte, LayeredWindowAttribute)

public static extern Types.BOOL SetLayeredWindowAttributes(User32.Types.HWND hWnd, Types.COLORREF crKey, byte bAlpha, User32.LayeredWindowAttribute dwFlags)

Parameters

hWnd User32.Types.HWND
crKey Types.COLORREF
bAlpha byte
dwFlags User32.LayeredWindowAttribute

Returns

Types.BOOL

SetProcessDpiAwarenessContext(nint)

public static bool SetProcessDpiAwarenessContext(nint dpiContext)

Parameters

dpiContext nint

Returns

bool

SetTimer(HWND, nuint, uint, nint)

public static extern nuint SetTimer(User32.Types.HWND hWnd, nuint nIDEvent, uint uElapse, nint lpTimerFunc)

Parameters

hWnd User32.Types.HWND
nIDEvent nuint
uElapse uint
lpTimerFunc nint

Returns

nuint

TrackMouseEvent(ref TRACKMOUSEEVENT)

public static extern Types.BOOL TrackMouseEvent(ref User32.TRACKMOUSEEVENT lpEventTrack)

Parameters

lpEventTrack User32.TRACKMOUSEEVENT

Returns

Types.BOOL

TranslateMessage(ref MSG)

public static int TranslateMessage(ref User32.MSG msg)

Parameters

msg User32.MSG

Returns

int