Xui.Runtime.Windows.Win32
Assembly: Xui.Runtime.Windows · C# declarations · Assembly overview
Types
class Dwmapistruct Dwmapi.MARGINSclass Kernel32class Typesstruct Types.BOOLstruct Types.COLORREFstruct Types.DWORDstruct Types.HDCstruct Types.HRESULTstruct Types.LPARAMstruct Types.LRESULTstruct Types.WPARAMclass User32enum User32.DPIAwarenessContextenum User32.ExtendedWindowStylesenum User32.HitTestenum User32.LayeredWindowAttributestruct User32.MSGstruct User32.NCCALCSIZE_PARAMSstruct User32.PAINTSTRUCTstruct User32.POINTstruct User32.RECTenum User32.SystemCursorenum User32.SystemMetricstruct User32.TRACKMOUSEEVENTenum User32.TrackMouseEventFlagsclass User32.Typesstruct User32.Types.HWNDenum User32.Types.SetWindowPosFlagsstruct User32.WINDOWPOSstruct User32.WNDCLASSEXWdelegate User32.WNDPROCenum User32.WindowClassStylesenum User32.WindowColorenum User32.WindowMessageenum User32.WindowPosFlagsenum User32.WindowStyles
class Dwmapi
public static partial class Dwmapi
{
public const string DwmapiLib = "dwmapi.dll";
public const uint DWMWA_CAPTION_COLOR = 35;
public const uint DWMWA_TEXT_COLOR = 36;
public const uint DWMWA_SYSTEMBACKDROP_TYPE = 38;
public const int DWMWA_COLOR_NONE = unchecked((int)0xFFFFFFFE);
public const int DWMSBT_MAINWINDOW = 2;
public const int DWMSBT_TRANSIENTWINDOW = 3;
public const int DWMSBT_TABBEDWINDOW = 4;
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int Left;
public int Right;
public int Top;
public int Bottom;
}
[LibraryImport(DwmapiLib)]
public static partial int DwmExtendFrameIntoClientArea(nint hwnd, ref MARGINS pMarInset);
[LibraryImport(DwmapiLib)]
public static partial int DwmSetWindowAttribute(nint hwnd, uint dwAttribute, ref int pvAttribute, int cbAttribute);
[LibraryImport(DwmapiLib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DwmDefWindowProc(nint hwnd, User32.WindowMessage msg, WPARAM wParam, LPARAM lParam, out LRESULT plResult);
[DllImport("dwmapi.dll")]
public static extern int DwmFlush();
}
public static unsafe partial class Dwmapi
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial int DwmExtendFrameIntoClientArea(nint hwnd, ref global::Xui.Runtime.Windows.Win32.Dwmapi.MARGINS pMarInset);
}
public static unsafe partial class Dwmapi
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial int DwmSetWindowAttribute(nint hwnd, uint dwAttribute, ref int pvAttribute, int cbAttribute);
}
public static unsafe partial class Dwmapi
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool DwmDefWindowProc(nint hwnd, global::Xui.Runtime.Windows.Win32.User32.WindowMessage msg, global::Xui.Runtime.Windows.Win32.Types.WPARAM wParam, global::Xui.Runtime.Windows.Win32.Types.LPARAM lParam, out global::Xui.Runtime.Windows.Win32.Types.LRESULT plResult);
}
int Dwmapi.DWMSBT_MAINWINDOW
public const int DWMSBT_MAINWINDOW = 2;
Mica backdrop (Windows 11 22H2+).
int Dwmapi.DWMSBT_TABBEDWINDOW
public const int DWMSBT_TABBEDWINDOW = 4;
Mica Alt / Tabbed backdrop (Windows 11 22H2+).
int Dwmapi.DWMSBT_TRANSIENTWINDOW
public const int DWMSBT_TRANSIENTWINDOW = 3;
Acrylic backdrop (Windows 11 22H2+).
uint Dwmapi.DWMWA_CAPTION_COLOR
public const uint DWMWA_CAPTION_COLOR = 35;
int Dwmapi.DWMWA_COLOR_NONE
public const int DWMWA_COLOR_NONE = unchecked((int)0xFFFFFFFE);
COLORREF value that indicates "no color" / transparent for DWM attributes.
uint Dwmapi.DWMWA_SYSTEMBACKDROP_TYPE
public const uint DWMWA_SYSTEMBACKDROP_TYPE = 38;
uint Dwmapi.DWMWA_TEXT_COLOR
public const uint DWMWA_TEXT_COLOR = 36;
bool Dwmapi.DwmDefWindowProc(nint hwnd, WindowMessage msg, WPARAM wParam, LPARAM lParam, out LRESULT plResult)
[LibraryImport(DwmapiLib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DwmDefWindowProc(nint hwnd, User32.WindowMessage msg, WPARAM wParam, LPARAM lParam, out LRESULT plResult);
int Dwmapi.DwmExtendFrameIntoClientArea(nint hwnd, ref MARGINS pMarInset)
[LibraryImport(DwmapiLib)]
public static partial int DwmExtendFrameIntoClientArea(nint hwnd, ref MARGINS pMarInset);
int Dwmapi.DwmFlush()
[DllImport("dwmapi.dll")]
public static extern int DwmFlush();
int Dwmapi.DwmSetWindowAttribute(nint hwnd, uint dwAttribute, ref int pvAttribute, int cbAttribute)
[LibraryImport(DwmapiLib)]
public static partial int DwmSetWindowAttribute(nint hwnd, uint dwAttribute, ref int pvAttribute, int cbAttribute);
string Dwmapi.DwmapiLib
public const string DwmapiLib = "dwmapi.dll";
struct Dwmapi.MARGINS
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int Left;
public int Right;
public int Top;
public int Bottom;
}
int MARGINS.Bottom
public int Bottom;
int MARGINS.Left
public int Left;
int MARGINS.Right
public int Right;
int MARGINS.Top
public int Top;
class Kernel32
public static partial class Kernel32
{
public const string Kernel32Lib = "kernel32.dll";
[LibraryImport(Kernel32Lib)]
public static partial uint GetCurrentThreadId();
}
public static unsafe partial class Kernel32
{
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetCurrentThreadId", ExactSpelling = true)]
public static extern partial uint GetCurrentThreadId();
}
uint Kernel32.GetCurrentThreadId()
[LibraryImport(Kernel32Lib)]
public static partial uint GetCurrentThreadId();
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadid
string Kernel32.Kernel32Lib
public const string Kernel32Lib = "kernel32.dll";
class Types
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public struct BOOL
{
public int value;
public BOOL(bool v);
public bool Value { get; }
public static implicit operator bool (BOOL v);
public static implicit operator BOOL(bool v);
}
}
public static partial class Types
{
public partial struct COLORREF
{
public uint __BBGGRR;
public COLORREF(uint v);
}
}
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public struct DWORD
{
public uint value;
public DWORD(uint value);
public uint Value { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator uint (DWORD v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator DWORD(uint v);
}
}
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public partial struct HDC
{
[LibraryImport(User32Lib, EntryPoint = "FillRect")]
public static partial BOOL HDCFillRect(nint hDC, ref RECT lprc, nint hbr);
[LibraryImport(User32Lib, EntryPoint = "FrameRect")]
public static partial BOOL HDCFrameRect(nint hDC, ref RECT lprc, nint hbr);
public nint value;
public HDC(nint value);
public bool FillRect(Rect rect, nint brush);
public bool FrameRect(Rect rect, nint brush);
public nint Value { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator nint(HDC v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator HDC(nint v);
}
}
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public struct HRESULT
{
public int value;
public HRESULT(int value);
public int Value { get; }
public bool Failed { get; }
public bool Succeeded { get; }
public static implicit operator bool (HRESULT res);
public static implicit operator int (HRESULT res);
}
}
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public struct LPARAM
{
public ulong value;
public LPARAM(ulong value);
public ulong Value { get; }
public short LoWord { get; }
public short HiWord { get; }
public Point MousePosition { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ulong (LPARAM v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator LPARAM(ulong v);
}
}
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public struct LRESULT
{
public int value;
public LRESULT(int value);
public int Value { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator int (LRESULT v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator LRESULT(int v);
}
}
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public struct WPARAM
{
public ulong value;
public WPARAM(ulong value);
public ulong Value { get; }
public short HiWord { get; }
public short LoWord { get; }
public Vector WheelDelta { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ulong (WPARAM v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator WPARAM(ulong v);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HDC
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL HDCFillRect(nint hDC, ref global::Xui.Runtime.Windows.Win32.User32.RECT lprc, nint hbr);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HDC
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL HDCFrameRect(nint hDC, ref global::Xui.Runtime.Windows.Win32.User32.RECT lprc, nint hbr);
}
}
struct Types.BOOL
[DebuggerDisplay("{Value}")]
public struct BOOL
{
public int value;
public BOOL(bool v);
public bool Value { get; }
public static implicit operator bool (BOOL v);
public static implicit operator BOOL(bool v);
}
BOOL.BOOL(bool v)
public BOOL(bool v);
bool BOOL.Value
public bool Value { get; }
BOOL.implicit operator BOOL(bool v)
public static implicit operator BOOL(bool v);
BOOL.implicit operator bool(BOOL v)
public static implicit operator bool (BOOL v);
int BOOL.value
public int value;
struct Types.COLORREF
public partial struct COLORREF
{
public uint __BBGGRR;
public COLORREF(uint v);
}
COLORREF.COLORREF(uint v)
public COLORREF(uint v);
uint COLORREF.__BBGGRR
public uint __BBGGRR;
struct Types.DWORD
[DebuggerDisplay("{Value}")]
public struct DWORD
{
public uint value;
public DWORD(uint value);
public uint Value { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator uint (DWORD v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator DWORD(uint v);
}
DWORD.DWORD(uint value)
public DWORD(uint value);
uint DWORD.Value
public uint Value { get; }
DWORD.implicit operator DWORD(uint v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator DWORD(uint v);
DWORD.implicit operator uint(DWORD v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator uint (DWORD v);
uint DWORD.value
public uint value;
struct Types.HDC
[DebuggerDisplay("{Value}")]
public partial struct HDC
{
[LibraryImport(User32Lib, EntryPoint = "FillRect")]
public static partial BOOL HDCFillRect(nint hDC, ref RECT lprc, nint hbr);
[LibraryImport(User32Lib, EntryPoint = "FrameRect")]
public static partial BOOL HDCFrameRect(nint hDC, ref RECT lprc, nint hbr);
public nint value;
public HDC(nint value);
public bool FillRect(Rect rect, nint brush);
public bool FrameRect(Rect rect, nint brush);
public nint Value { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator nint(HDC v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator HDC(nint v);
}
public unsafe partial struct HDC
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL HDCFillRect(nint hDC, ref global::Xui.Runtime.Windows.Win32.User32.RECT lprc, nint hbr);
}
public unsafe partial struct HDC
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL HDCFrameRect(nint hDC, ref global::Xui.Runtime.Windows.Win32.User32.RECT lprc, nint hbr);
}
HDC.HDC(nint value)
public HDC(nint value);
bool HDC.FillRect(Rect rect, nint brush)
public bool FillRect(Rect rect, nint brush);
bool HDC.FrameRect(Rect rect, nint brush)
public bool FrameRect(Rect rect, nint brush);
BOOL HDC.HDCFillRect(nint hDC, ref RECT lprc, nint hbr)
[LibraryImport(User32Lib, EntryPoint = "FillRect")]
public static partial BOOL HDCFillRect(nint hDC, ref RECT lprc, nint hbr);
BOOL HDC.HDCFrameRect(nint hDC, ref RECT lprc, nint hbr)
[LibraryImport(User32Lib, EntryPoint = "FrameRect")]
public static partial BOOL HDCFrameRect(nint hDC, ref RECT lprc, nint hbr);
nint HDC.Value
public nint Value { get; }
HDC.implicit operator HDC(nint v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator HDC(nint v);
HDC.implicit operator nint(HDC v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator nint(HDC v);
nint HDC.value
public nint value;
struct Types.HRESULT
[DebuggerDisplay("{Value}")]
public struct HRESULT
{
public int value;
public HRESULT(int value);
public int Value { get; }
public bool Failed { get; }
public bool Succeeded { get; }
public static implicit operator bool (HRESULT res);
public static implicit operator int (HRESULT res);
}
HRESULT.HRESULT(int value)
public HRESULT(int value);
bool HRESULT.Failed
public bool Failed { get; }
bool HRESULT.Succeeded
public bool Succeeded { get; }
int HRESULT.Value
public int Value { get; }
HRESULT.implicit operator bool(HRESULT res)
public static implicit operator bool (HRESULT res);
HRESULT.implicit operator int(HRESULT res)
public static implicit operator int (HRESULT res);
int HRESULT.value
public int value;
struct Types.LPARAM
[DebuggerDisplay("{Value}")]
public struct LPARAM
{
public ulong value;
public LPARAM(ulong value);
public ulong Value { get; }
public short LoWord { get; }
public short HiWord { get; }
public Point MousePosition { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ulong (LPARAM v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator LPARAM(ulong v);
}
LPARAM.LPARAM(ulong value)
public LPARAM(ulong value);
short LPARAM.HiWord
public short HiWord { get; }
short LPARAM.LoWord
public short LoWord { get; }
Point LPARAM.MousePosition
public Point MousePosition { get; }
ulong LPARAM.Value
public ulong Value { get; }
LPARAM.implicit operator LPARAM(ulong v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator LPARAM(ulong v);
LPARAM.implicit operator ulong(LPARAM v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ulong (LPARAM v);
ulong LPARAM.value
public ulong value;
struct Types.LRESULT
[DebuggerDisplay("{Value}")]
public struct LRESULT
{
public int value;
public LRESULT(int value);
public int Value { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator int (LRESULT v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator LRESULT(int v);
}
LRESULT.LRESULT(int value)
public LRESULT(int value);
int LRESULT.Value
public int Value { get; }
LRESULT.implicit operator LRESULT(int v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator LRESULT(int v);
LRESULT.implicit operator int(LRESULT v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator int (LRESULT v);
int LRESULT.value
public int value;
struct Types.WPARAM
[DebuggerDisplay("{Value}")]
public struct WPARAM
{
public ulong value;
public WPARAM(ulong value);
public ulong Value { get; }
public short HiWord { get; }
public short LoWord { get; }
public Vector WheelDelta { get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ulong (WPARAM v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator WPARAM(ulong v);
}
WPARAM.WPARAM(ulong value)
public WPARAM(ulong value);
short WPARAM.HiWord
public short HiWord { get; }
short WPARAM.LoWord
public short LoWord { get; }
ulong WPARAM.Value
public ulong Value { get; }
Vector WPARAM.WheelDelta
public Vector WheelDelta { get; }
WPARAM.implicit operator WPARAM(ulong v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator WPARAM(ulong v);
WPARAM.implicit operator ulong(WPARAM v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ulong (WPARAM v);
ulong WPARAM.value
public ulong value;
class User32
public static partial class User32
{
[Flags]
public enum DPIAwarenessContext : long
{
DPI_AWARENESS_CONTEXT_UNAWARE = -1,
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = -2,
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = -3,
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = -4,
DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED = -5
}
}
public static partial class User32
{
[Flags]
public enum ExtendedWindowStyles : long
{
WS_EX_ACCEPTFILES = 0x00000010L,
WS_EX_APPWINDOW = 0x00040000L,
WS_EX_CLIENTEDGE = 0x00000200L,
WS_EX_COMPOSITED = 0x02000000L,
WS_EX_CONTEXTHELP = 0x00000400L,
WS_EX_CONTROLPARENT = 0x00010000L,
WS_EX_DLGMODALFRAME = 0x00000001L,
WS_EX_LAYERED = 0x00080000,
WS_EX_LAYOUTRTL = 0x00400000L,
WS_EX_LEFT = 0x00000000L,
WS_EX_LEFTSCROLLBAR = 0x00004000L,
WS_EX_LTRREADING = 0x00000000L,
WS_EX_MDICHILD = 0x00000040L,
WS_EX_NOACTIVATE = 0x08000000L,
WS_EX_NOINHERITLAYOUT = 0x00100000L,
WS_EX_NOPARENTNOTIFY = 0x00000004L,
WS_EX_NOREDIRECTIONBITMAP = 0x00200000L,
WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE),
WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST),
WS_EX_RIGHT = 0x00001000L,
WS_EX_RIGHTSCROLLBAR = 0x00000000L,
WS_EX_RTLREADING = 0x00002000L,
WS_EX_STATICEDGE = 0x00020000L,
WS_EX_TOOLWINDOW = 0x00000080L,
WS_EX_TOPMOST = 0x00000008L,
WS_EX_TRANSPARENT = 0x00000020L,
WS_EX_WINDOWEDGE = 0x00000100L,
}
}
public partial class User32
{
public enum HitTest : int
{
HTERROR = -2,
HTTRANSPARENT = -1,
HTNOWHERE = 0,
HTCLIENT = 1,
HTCAPTION = 2,
HTSYSMENU = 3,
HTGROWBOX = 4,
HTSIZE = HTGROWBOX,
HTMENU = 5,
HTHSCROLL = 6,
HTVSCROLL = 7,
HTMINBUTTON = 8,
HTMAXBUTTON = 9,
HTLEFT = 10,
HTRIGHT = 11,
HTTOP = 12,
HTTOPLEFT = 13,
HTTOPRIGHT = 14,
HTBOTTOM = 15,
HTBOTTOMLEFT = 16,
HTBOTTOMRIGHT = 17,
HTBORDER = 18,
HTREDUCE = HTMINBUTTON,
HTZOOM = HTMAXBUTTON,
HTSIZEFIRST = HTLEFT,
HTSIZELAST = HTBOTTOMRIGHT,
HTOBJECT = 19,
HTCLOSE = 20,
HTHELP = 21,
}
}
public static partial class User32
{
[Flags]
public enum LayeredWindowAttribute : long
{
LWA_COLORKEY = 0x00000001,
LWA_ALPHA = 0x00000002,
}
}
public static partial class User32
{
[StructLayout(LayoutKind.Sequential)]
public struct MSG
{
public nint hWnd;
public WindowMessage message;
public WPARAM wParam;
public LPARAM lParam;
public DWORD time;
public POINT pt;
public DWORD lPrivate;
}
}
public static partial class User32
{
public unsafe struct NCCALCSIZE_PARAMS
{
public RECT r1;
public RECT r2;
public RECT r3;
public WINDOWPOS* lppos;
}
}
public static partial class User32
{
[StructLayout(LayoutKind.Explicit, Size = 72)]
public struct PAINTSTRUCT
{
[FieldOffset(0)]
public uint hdc;
[FieldOffset(8)]
public BOOL fErase;
[FieldOffset(12)]
public RECT rcPaint;
[FieldOffset(28)]
public BOOL fRestore;
[FieldOffset(32)]
public BOOL fIncUpdate;
[FieldOffset(36)]
public UInt64 rgbReserved1, rgbReserved2, rgbReserved3, rgbReserved4;
}
}
public static partial class User32
{
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;
}
}
public static partial class User32
{
[StructLayout(LayoutKind.Explicit)]
public struct RECT
{
[FieldOffset(0)]
public int Left;
[FieldOffset(4)]
public int Top;
[FieldOffset(8)]
public int Right;
[FieldOffset(12)]
public int Bottom;
public RECT(Rect rect);
}
}
public static partial class User32
{
public static partial class Types
{
[Flags]
public enum SetWindowPosFlags : uint
{
SWP_NOSIZE = 0x0001,
SWP_NOMOVE = 0x0002,
SWP_NOZORDER = 0x0004,
SWP_NOREDRAW = 0x0008,
SWP_NOACTIVATE = 0x0010,
SWP_FRAMECHANGED = 0x0020,
SWP_SHOWWINDOW = 0x0040,
SWP_HIDEWINDOW = 0x0080,
SWP_NOCOPYBITS = 0x0100,
SWP_NOOWNERZORDER = 0x0200,
SWP_NOSENDCHANGING = 0x0400,
SWP_DEFERERASE = 0x2000,
SWP_ASYNCWINDOWPOS = 0x4000
}
}
}
public static partial class User32
{
public enum SystemCursor : int
{
Arrow = 32512,
IBeam = 32513,
Wait = 32514,
Cross = 32515,
UpArrow = 32516,
SizeNWSE = 32642,
SizeNESW = 32643,
SizeWE = 32644,
SizeNS = 32645,
SizeAll = 32646,
No = 32648,
Hand = 32649,
AppStarting = 32650,
Help = 32651,
}
}
public static partial class User32
{
public enum SystemMetric : int
{
SM_CYCAPTION = 4,
SM_CXSIZE = 30,
SM_CYSIZE = 31,
SM_CXSIZEFRAME = 32,
SM_CYSIZEFRAME = 33,
SM_CXPADDEDBORDER = 92,
}
}
public static partial class User32
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public struct TRACKMOUSEEVENT
{
[FieldOffset(0)]
public uint cbSize;
[FieldOffset(4)]
public TrackMouseEventFlags dwFlags;
[FieldOffset(8)]
public HWND hwndTrack;
[FieldOffset(16)]
public uint dwHoverTime;
}
}
public static partial class User32
{
[Flags]
public enum TrackMouseEventFlags : uint
{
TME_HOVER = 0x00000001,
TME_LEAVE = 0x00000002,
TME_CANCEL = 0x80000000
}
}
public static partial class User32
{
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public partial struct HWND : IEquatable<HWND>
{
public static readonly HWND HWND_TOPMOST;
public static readonly HWND HWND_NOTOPMOST;
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ShowWindow(HWND hWnd, int nCmdShow);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool UpdateWindow(HWND hWnd);
[LibraryImport(User32Lib, EntryPoint = "SetWindowTextW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpString);
[LibraryImport(User32Lib, EntryPoint = "GetWindowTextW")]
public static partial int GetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] out string lpString, int maxLength);
[LibraryImport(User32Lib, EntryPoint = "SetWindowPos")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, Types.SetWindowPosFlags uFlags);
[LibraryImport(User32Lib, EntryPoint = "GetClientRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetClientRect(HWND hWnd, out RECT rc);
[LibraryImport(User32Lib, EntryPoint = "DefWindowProcW")]
public static partial LRESULT DefWindowProc(HWND hWnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, ref RECT rect, [MarshalAs(UnmanagedType.Bool)] bool erase);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, nint rectPtr, [MarshalAs(UnmanagedType.Bool)] bool erase);
[LibraryImport(User32Lib)]
public static partial HDC BeginPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
[LibraryImport(User32Lib)]
public static partial BOOL EndPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
[LibraryImport(User32Lib)]
public static partial BOOL ScreenToClient(HWND hWnd, ref POINT lpPoint);
[LibraryImport(User32Lib)]
public static partial uint GetDpiForWindow(HWND hwnd);
[LibraryImport(User32Lib, EntryPoint = "SetCapture")]
public static partial HWND SetCapture(HWND hWnd);
[LibraryImport(User32Lib, EntryPoint = "ReleaseCapture")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReleaseCapture();
[LibraryImport(User32Lib, EntryPoint = "GetWindowRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetWindowRect(HWND hWnd, out RECT lpRect);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool IsZoomed(HWND hWnd);
public nint value;
public HWND(nint value);
public bool SetWindowText(string text);
public int GetWindowText(out string text, int maxLength);
public bool GetClientRect(out RECT rect);
public void ShowWindow(int nCmdShow = 1);
public bool UpdateWindow();
public void Invalidate();
public bool ScreenToClient(ref POINT point);
public bool GetWindowRect(out RECT rect);
public bool IsMaximized { get; }
public LRESULT DefWindowProc(WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
public HDC BeginPaint(ref PAINTSTRUCT lpPaint);
public bool EndPaint(ref PAINTSTRUCT lpPaint);
public nint Value { get; }
public bool Equals(HWND other);
public override bool Equals(object? obj);
public override int GetHashCode();
public static bool operator ==(HWND left, HWND right);
public static bool operator !=(HWND left, HWND right);
public uint DPI { get; }
public NFloat DPIScale { get; }
public HWND CaptureMouse();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator nint(HWND v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator HWND(nint v);
}
}
}
public static partial class User32
{
public const string User32Lib = "user32.dll";
public static readonly nint Lib;
[LibraryImport(User32Lib)]
public static partial nint GetSysColorBrush(int nIndex);
[LibraryImport(User32Lib, EntryPoint = "RegisterClassExW")]
public static partial ushort RegisterClassEx(WNDCLASSEXW p);
[LibraryImport(User32Lib, EntryPoint = "CreateWindowExW")]
public static partial nint CreateWindowEx(uint dwExStyle, ushort atom, [MarshalAs(UnmanagedType.LPUTF8Str)] string lpWindowName, uint dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, nint hMenu, nint hInstance, nint lpParam);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetProcessDpiAwarenessContext(nint dpiContext);
[LibraryImport(User32Lib)]
public static partial int TranslateMessage(ref MSG msg);
[LibraryImport(User32Lib, EntryPoint = "DispatchMessageW")]
public static partial nint DispatchMessage(ref MSG msg);
[LibraryImport(User32Lib, EntryPoint = "GetMessageW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetMessage(ref MSG msg, HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax);
[LibraryImport(User32Lib, EntryPoint = "PeekMessageW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool PeekMessage(ref MSG msg, HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg);
[LibraryImport(User32Lib, EntryPoint = "PostMessageW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool PostMessage(HWND hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam);
[LibraryImport(User32Lib)]
public static partial nuint SetTimer(HWND hWnd, nuint nIDEvent, uint uElapse, nint lpTimerFunc);
[LibraryImport(User32Lib, EntryPoint = "SendMessageW")]
public static partial nint SendMessage(HWND hWnd, uint Msg, nuint wParam, nint lParam);
[LibraryImport(User32Lib)]
public static unsafe partial BOOL SetLayeredWindowAttributes(HWND hWnd, COLORREF crKey, byte bAlpha, LayeredWindowAttribute dwFlags);
[LibraryImport(User32Lib)]
public static partial uint GetDpiForSystem();
[DllImport(User32Lib, SetLastError = true)]
public static extern BOOL TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack);
[LibraryImport(User32Lib, EntryPoint = "LoadCursorW", SetLastError = true)]
public static partial nint LoadCursor(nint hInstance, int lpCursorName);
[LibraryImport(User32Lib)]
public static partial nint SetCursor(nint hCursor);
[LibraryImport(User32Lib)]
public static partial short GetKeyState(int nVirtKey);
[LibraryImport(User32Lib, EntryPoint = "PostThreadMessageW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool PostThreadMessage(uint idThread, uint Msg, nuint wParam, nint lParam);
[LibraryImport(User32Lib, SetLastError = true)]
public static partial uint MsgWaitForMultipleObjectsEx(uint nCount, nint[]? pHandles, uint dwMilliseconds, uint dwWakeMask, uint dwFlags);
[LibraryImport(User32Lib)]
public static partial int GetSystemMetricsForDpi(SystemMetric nIndex, uint dpi);
[LibraryImport(User32Lib, EntryPoint = "GetSystemMetrics")]
public static partial int GetSystemMetrics(SystemMetric nIndex);
[LibraryImport(User32Lib)]
public static partial void PostQuitMessage(int nExitCode);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DestroyWindow(HWND hWnd);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ClientToScreen(HWND hWnd, ref POINT lpPoint);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetCursorPos(out POINT lpPoint);
}
public static partial class User32
{
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
{
public nint hwnd;
public nint hwndInsertAfter;
public int x;
public int y;
public int cx;
public int cy;
public uint flags;
}
}
public static partial class User32
{
[StructLayout(LayoutKind.Sequential)]
public struct WNDCLASSEXW
{
public uint cbSize;
public WindowClassStyles styles;
public nint lpfnWndProc;
public int cbClsExtra;
public int cbWndExtra;
public nint hInstance;
public nint hIcon;
public nint hCursor;
public nint hbrBackground;
public nint lpszMenuName;
public nint lpszClassName;
public nint hIconSm;
}
}
public static partial class User32
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate int WNDPROC(HWND hwnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
}
public static partial class User32
{
[Flags]
public enum WindowClassStyles : uint
{
CS_BYTEALIGNCLIENT = 0x1000,
CS_BYTEALIGNWINDOW = 0x2000,
CS_CLASSDC = 0x0040,
CS_DBLCLKS = 0x0008,
CS_DROPSHADOW = 0x00020000,
CS_GLOBALCLASS = 0x4000,
CS_HREDRAW = 0x0002,
CS_NOCLOSE = 0x0200,
CS_OWNDC = 0x0020,
CS_PARENTDC = 0x0080,
CS_SAVEBITS = 0x0800,
CS_VREDRAW = 0x0001,
}
}
public static partial class User32
{
public enum WindowColor : int
{
COLOR_WINDOW = 5,
COLOR_3DFACE = 15
}
}
public static partial class User32
{
public enum WindowMessage : uint
{
WM_NULL = 0x0000,
WM_CREATE = 0x0001,
WM_DESTROY = 0x0002,
WM_MOVE = 0x0003,
WM_SIZE = 0x0005,
WM_ERASEBKGND = 0x0014,
WM_SETCURSOR = 0x0020,
WM_ACTIVATEAPP = 0x001C,
WM_CANCELMODE = 0x001F,
WM_CHILDACTIVATE = 0x0022,
WM_CLOSE = 0x0010,
WM_COMPACTING = 0x0041,
WM_ENABLE = 0x000A,
WM_ENTERSIZEMOVE = 0x0231,
WM_EXITSIZEMOVE = 0x0232,
WM_GETICON = 0x007F,
WM_GETMINMAXINFO = 0x0024,
WM_INPUTLANGCHANGE = 0x0051,
WM_INPUTLANGCHANGEREQUEST = 0x0050,
WM_MOVING = 0x0216,
WM_NCACTIVATE = 0x0086,
WM_NCCALCSIZE = 0x0083,
WM_NCCREATE = 0x0081,
WM_NCDESTROY = 0x0082,
WM_QUERYDRAGICON = 0x0037,
WM_QUERYOPEN = 0x0013,
WM_QUIT = 0x0012,
WM_SHOWWINDOW = 0x0018,
WM_SIZING = 0x0214,
WM_STYLECHANGED = 0x007D,
WM_STYLECHANGING = 0x007C,
WM_THEMECHANGED = 0x031A,
WM_USERCHANGED = 0x0054,
WM_WINDOWPOSCHANGED = 0x0047,
WM_WINDOWPOSCHANGING = 0x0046,
WM_CAPTURECHANGED = 0x0215,
WM_LBUTTONDBLCLK = 0x0203,
WM_LBUTTONDOWN = 0x0201,
WM_LBUTTONUP = 0x0202,
WM_MBUTTONDBLCLK = 0x0209,
WM_MBUTTONDOWN = 0x0207,
WM_MBUTTONUP = 0x0208,
WM_MOUSEACTIVATE = 0x0021,
WM_MOUSEHOVER = 0x02A1,
WM_MOUSEHWHEEL = 0x020E,
WM_MOUSELEAVE = 0x02A3,
WM_MOUSEMOVE = 0x0200,
WM_MOUSEWHEEL = 0x020A,
WM_NCHITTEST = 0x0084,
WM_NCLBUTTONDBLCLK = 0x00A3,
WM_NCLBUTTONDOWN = 0x00A1,
WM_NCLBUTTONUP = 0x00A2,
WM_NCMBUTTONDBLCLK = 0x00A9,
WM_NCMBUTTONDOWN = 0x00A7,
WM_NCMBUTTONUP = 0x00A8,
WM_NCMOUSEHOVER = 0x02A0,
WM_NCMOUSELEAVE = 0x02A2,
WM_NCMOUSEMOVE = 0x00A0,
WM_NCRBUTTONDBLCLK = 0x00A6,
WM_NCRBUTTONDOWN = 0x00A4,
WM_NCRBUTTONUP = 0x00A5,
WM_NCXBUTTONDBLCLK = 0x00AD,
WM_NCXBUTTONDOWN = 0x00AB,
WM_NCXBUTTONUP = 0x00AC,
WM_RBUTTONDBLCLK = 0x0206,
WM_RBUTTONDOWN = 0x0204,
WM_RBUTTONUP = 0x0205,
WM_XBUTTONDBLCLK = 0x020D,
WM_XBUTTONDOWN = 0x020B,
WM_XBUTTONUP = 0x020C,
WM_ACTIVATE = 0x0006,
WM_APPCOMMAND = 0x0319,
WM_CHAR = 0x0102,
WM_DEADCHAR = 0x0103,
WM_HOTKEY = 0x0312,
WM_KEYDOWN = 0x0100,
WM_KEYUP = 0x0101,
WM_KILLFOCUS = 0x0008,
WM_SETFOCUS = 0x0007,
WM_SYSDEADCHAR = 0x0107,
WM_SYSKEYDOWN = 0x0104,
WM_SYSKEYUP = 0x0105,
WM_UNICHAR = 0x0109,
WM_DISPLAYCHANGE = 0x7E,
WM_NCPAINT = 0x85,
WM_PAINT = 0xF,
WM_PRINT = 0x317,
WM_PRINTCLIENT = 0x318,
WM_SETREDRAW = 0xB,
WM_SYNCPAINT = 0x88,
WM_INITMENUPOPUP = 0x0117,
WM_MENUCHAR = 0x0120,
WM_MENUSELECT = 0x011F,
WM_SYSCHAR = 0x0106,
WM_SYSCOMMAND = 0x0112,
WM_TIMER = 0x0113,
WM_DPICHANGED = 0x02E0,
WM_SETICON = 0x0080,
}
}
public static partial class User32
{
[Flags]
public enum WindowPosFlags : uint
{
None = 0,
NoSize = 0x0001,
NoMove = 0x0002,
NoZOrder = 0x0004,
NoRedraw = 0x0008,
NoActivate = 0x0010,
FrameChanged = 0x0020,
ShowWindow = 0x0040,
HideWindow = 0x0080,
NoCopyBits = 0x0100,
NoOwnerZOrder = 0x0200,
NoSendChanging = 0x0400,
DeferErase = 0x2000,
AsyncWindowPos = 0x4000,
}
}
public static partial class User32
{
[Flags]
public enum WindowStyles : long
{
WS_BORDER = 0x00800000L,
WS_CAPTION = 0x00C00000L,
WS_CHILD = 0x40000000L,
WS_CHILDWINDOW = 0x40000000L,
WS_CLIPCHILDREN = 0x02000000L,
WS_CLIPSIBLINGS = 0x04000000L,
WS_DISABLED = 0x08000000L,
WS_DLGFRAME = 0x00400000L,
WS_GROUP = 0x00020000L,
WS_HSCROLL = 0x00100000L,
WS_ICONIC = 0x20000000L,
WS_MAXIMIZE = 0x01000000L,
WS_MAXIMIZEBOX = 0x00010000L,
WS_MINIMIZE = 0x20000000L,
WS_MINIMIZEBOX = 0x00020000L,
WS_OVERLAPPED = 0x00000000L,
WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX),
WS_POPUP = 0x80000000L,
WS_POPUPWINDOW = (WS_POPUP | WS_BORDER | WS_SYSMENU),
WS_SIZEBOX = 0x00040000L,
WS_SYSMENU = 0x00080000L,
WS_TABSTOP = 0x00010000L,
WS_THICKFRAME = 0x00040000L,
WS_TILED = 0x00000000L,
WS_TILEDWINDOW = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX),
WS_VISIBLE = 0x10000000L,
WS_VSCROLL = 0x00200000L,
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool ShowWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, int nCmdShow);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool UpdateWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool SetWindowText(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, string lpString);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial int GetWindowText(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out string lpString, int maxLength);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool SetWindowPos(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWndInsertAfter, int X, int Y, int cx, int cy, global::Xui.Runtime.Windows.Win32.User32.Types.SetWindowPosFlags uFlags);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetClientRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out global::Xui.Runtime.Windows.Win32.User32.RECT rc);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "DefWindowProcW", ExactSpelling = true)]
public static extern partial global::Xui.Runtime.Windows.Win32.Types.LRESULT DefWindowProc(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.User32.WindowMessage uMsg, global::Xui.Runtime.Windows.Win32.Types.WPARAM wParam, global::Xui.Runtime.Windows.Win32.Types.LPARAM lParam);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool InvalidateRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.RECT rect, bool erase);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool InvalidateRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, nint rectPtr, bool erase);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.HDC BeginPaint(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.PAINTSTRUCT lpPaint);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL EndPaint(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.PAINTSTRUCT lpPaint);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL ScreenToClient(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.POINT lpPoint);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetDpiForWindow", ExactSpelling = true)]
public static extern partial uint GetDpiForWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hwnd);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCapture", ExactSpelling = true)]
public static extern partial global::Xui.Runtime.Windows.Win32.User32.Types.HWND SetCapture(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool ReleaseCapture();
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetWindowRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out global::Xui.Runtime.Windows.Win32.User32.RECT lpRect);
}
}
}
public static unsafe partial class User32
{
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool IsZoomed(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
}
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetSysColorBrush", ExactSpelling = true)]
public static extern partial nint GetSysColorBrush(int nIndex);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "RegisterClassExW", ExactSpelling = true)]
public static extern partial ushort RegisterClassEx(global::Xui.Runtime.Windows.Win32.User32.WNDCLASSEXW p);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial nint CreateWindowEx(uint dwExStyle, ushort atom, string lpWindowName, uint dwStyle, int X, int Y, int nWidth, int nHeight, global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWndParent, nint hMenu, nint hInstance, nint lpParam);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool SetProcessDpiAwarenessContext(nint dpiContext);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial int TranslateMessage(ref global::Xui.Runtime.Windows.Win32.User32.MSG msg);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial nint DispatchMessage(ref global::Xui.Runtime.Windows.Win32.User32.MSG msg);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetMessage(ref global::Xui.Runtime.Windows.Win32.User32.MSG msg, global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool PeekMessage(ref global::Xui.Runtime.Windows.Win32.User32.MSG msg, global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool PostMessage(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.User32.WindowMessage Msg, global::Xui.Runtime.Windows.Win32.Types.WPARAM wParam, global::Xui.Runtime.Windows.Win32.Types.LPARAM lParam);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetTimer", ExactSpelling = true)]
public static extern partial nuint SetTimer(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, nuint nIDEvent, uint uElapse, nint lpTimerFunc);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SendMessageW", ExactSpelling = true)]
public static extern partial nint SendMessage(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, uint Msg, nuint wParam, nint lParam);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetLayeredWindowAttributes", ExactSpelling = true)]
public static unsafe extern partial global::Xui.Runtime.Windows.Win32.Types.BOOL SetLayeredWindowAttributes(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.Types.COLORREF crKey, byte bAlpha, global::Xui.Runtime.Windows.Win32.User32.LayeredWindowAttribute dwFlags);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetDpiForSystem", ExactSpelling = true)]
public static extern partial uint GetDpiForSystem();
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial nint LoadCursor(nint hInstance, int lpCursorName);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursor", ExactSpelling = true)]
public static extern partial nint SetCursor(nint hCursor);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetKeyState", ExactSpelling = true)]
public static extern partial short GetKeyState(int nVirtKey);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool PostThreadMessage(uint idThread, uint Msg, nuint wParam, nint lParam);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial uint MsgWaitForMultipleObjectsEx(uint nCount, nint[] pHandles, uint dwMilliseconds, uint dwWakeMask, uint dwFlags);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetSystemMetricsForDpi", ExactSpelling = true)]
public static extern partial int GetSystemMetricsForDpi(global::Xui.Runtime.Windows.Win32.User32.SystemMetric nIndex, uint dpi);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetSystemMetrics", ExactSpelling = true)]
public static extern partial int GetSystemMetrics(global::Xui.Runtime.Windows.Win32.User32.SystemMetric nIndex);
}
public static unsafe partial class User32
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "PostQuitMessage", ExactSpelling = true)]
public static extern partial void PostQuitMessage(int nExitCode);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool DestroyWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool ClientToScreen(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.POINT lpPoint);
}
public static unsafe partial class User32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetCursorPos(out global::Xui.Runtime.Windows.Win32.User32.POINT lpPoint);
}
bool User32.ClientToScreen(HWND hWnd, ref POINT lpPoint)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ClientToScreen(HWND hWnd, ref POINT lpPoint);
nint User32.CreateWindowEx(uint dwExStyle, ushort atom, string lpWindowName, uint dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, nint hMenu, nint hInstance, nint lpParam)
[LibraryImport(User32Lib, EntryPoint = "CreateWindowExW")]
public static partial nint CreateWindowEx(uint dwExStyle, ushort atom, [MarshalAs(UnmanagedType.LPUTF8Str)] string lpWindowName, uint dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, nint hMenu, nint hInstance, nint lpParam);
bool User32.DestroyWindow(HWND hWnd)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DestroyWindow(HWND hWnd);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroywindow
nint User32.DispatchMessage(ref MSG msg)
[LibraryImport(User32Lib, EntryPoint = "DispatchMessageW")]
public static partial nint DispatchMessage(ref MSG msg);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-dispatchmessagew
bool User32.GetCursorPos(out POINT lpPoint)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetCursorPos(out POINT lpPoint);
uint User32.GetDpiForSystem()
[LibraryImport(User32Lib)]
public static partial uint GetDpiForSystem();
short User32.GetKeyState(int nVirtKey)
[LibraryImport(User32Lib)]
public static partial short GetKeyState(int nVirtKey);
bool User32.GetMessage(ref MSG msg, HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax)
[LibraryImport(User32Lib, EntryPoint = "GetMessageW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetMessage(ref MSG msg, HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-dispatchmessagew
nint User32.GetSysColorBrush(int nIndex)
[LibraryImport(User32Lib)]
public static partial nint GetSysColorBrush(int nIndex);
int User32.GetSystemMetrics(SystemMetric nIndex)
[LibraryImport(User32Lib, EntryPoint = "GetSystemMetrics")]
public static partial int GetSystemMetrics(SystemMetric nIndex);
int User32.GetSystemMetricsForDpi(SystemMetric nIndex, uint dpi)
[LibraryImport(User32Lib)]
public static partial int GetSystemMetricsForDpi(SystemMetric nIndex, uint dpi);
nint User32.Lib
public static readonly nint Lib;
nint User32.LoadCursor(nint hInstance, int lpCursorName)
[LibraryImport(User32Lib, EntryPoint = "LoadCursorW", SetLastError = true)]
public static partial nint LoadCursor(nint hInstance, int lpCursorName);
uint User32.MsgWaitForMultipleObjectsEx(uint nCount, nint[]? pHandles, uint dwMilliseconds, uint dwWakeMask, uint dwFlags)
[LibraryImport(User32Lib, SetLastError = true)]
public static partial uint MsgWaitForMultipleObjectsEx(uint nCount, nint[]? pHandles, uint dwMilliseconds, uint dwWakeMask, uint dwFlags);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-msgwaitformultipleobjectsex
bool User32.PeekMessage(ref MSG msg, HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg)
[LibraryImport(User32Lib, EntryPoint = "PeekMessageW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool PeekMessage(ref MSG msg, HWND hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-dispatchmessagew
bool User32.PostMessage(HWND hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam)
[LibraryImport(User32Lib, EntryPoint = "PostMessageW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool PostMessage(HWND hWnd, WindowMessage Msg, WPARAM wParam, LPARAM lParam);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postmessagew
void User32.PostQuitMessage(int nExitCode)
[LibraryImport(User32Lib)]
public static partial void PostQuitMessage(int nExitCode);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postquitmessage
bool User32.PostThreadMessage(uint idThread, uint Msg, nuint wParam, nint lParam)
[LibraryImport(User32Lib, EntryPoint = "PostThreadMessageW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool PostThreadMessage(uint idThread, uint Msg, nuint wParam, nint lParam);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postthreadmessagew
ushort User32.RegisterClassEx(WNDCLASSEXW p)
[LibraryImport(User32Lib, EntryPoint = "RegisterClassExW")]
public static partial ushort RegisterClassEx(WNDCLASSEXW p);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerclassexw
nint User32.SendMessage(HWND hWnd, uint Msg, nuint wParam, nint lParam)
[LibraryImport(User32Lib, EntryPoint = "SendMessageW")]
public static partial nint SendMessage(HWND hWnd, uint Msg, nuint wParam, nint lParam);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagew
nint User32.SetCursor(nint hCursor)
[LibraryImport(User32Lib)]
public static partial nint SetCursor(nint hCursor);
BOOL User32.SetLayeredWindowAttributes(HWND hWnd, COLORREF crKey, byte bAlpha, LayeredWindowAttribute dwFlags)
[LibraryImport(User32Lib)]
public static unsafe partial BOOL SetLayeredWindowAttributes(HWND hWnd, COLORREF crKey, byte bAlpha, LayeredWindowAttribute dwFlags);
bool User32.SetProcessDpiAwarenessContext(nint dpiContext)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetProcessDpiAwarenessContext(nint dpiContext);
nuint User32.SetTimer(HWND hWnd, nuint nIDEvent, uint uElapse, nint lpTimerFunc)
[LibraryImport(User32Lib)]
public static partial nuint SetTimer(HWND hWnd, nuint nIDEvent, uint uElapse, nint lpTimerFunc);
BOOL User32.TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack)
[DllImport(User32Lib, SetLastError = true)]
public static extern BOOL TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack);
int User32.TranslateMessage(ref MSG msg)
[LibraryImport(User32Lib)]
public static partial int TranslateMessage(ref MSG msg);
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-translatemessage
string User32.User32Lib
public const string User32Lib = "user32.dll";
enum User32.DPIAwarenessContext
[Flags]
public enum DPIAwarenessContext : long
{
DPI_AWARENESS_CONTEXT_UNAWARE = -1,
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = -2,
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = -3,
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = -4,
DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED = -5
}
DPIAwarenessContext.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = -3
DPIAwarenessContext.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = -4
DPIAwarenessContext.DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = -2
DPIAwarenessContext.DPI_AWARENESS_CONTEXT_UNAWARE
DPI_AWARENESS_CONTEXT_UNAWARE = -1
DPIAwarenessContext.DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED
DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED = -5
enum User32.ExtendedWindowStyles
https://learn.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles
[Flags]
public enum ExtendedWindowStyles : long
{
WS_EX_ACCEPTFILES = 0x00000010L,
WS_EX_APPWINDOW = 0x00040000L,
WS_EX_CLIENTEDGE = 0x00000200L,
WS_EX_COMPOSITED = 0x02000000L,
WS_EX_CONTEXTHELP = 0x00000400L,
WS_EX_CONTROLPARENT = 0x00010000L,
WS_EX_DLGMODALFRAME = 0x00000001L,
WS_EX_LAYERED = 0x00080000,
WS_EX_LAYOUTRTL = 0x00400000L,
WS_EX_LEFT = 0x00000000L,
WS_EX_LEFTSCROLLBAR = 0x00004000L,
WS_EX_LTRREADING = 0x00000000L,
WS_EX_MDICHILD = 0x00000040L,
WS_EX_NOACTIVATE = 0x08000000L,
WS_EX_NOINHERITLAYOUT = 0x00100000L,
WS_EX_NOPARENTNOTIFY = 0x00000004L,
WS_EX_NOREDIRECTIONBITMAP = 0x00200000L,
WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE),
WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST),
WS_EX_RIGHT = 0x00001000L,
WS_EX_RIGHTSCROLLBAR = 0x00000000L,
WS_EX_RTLREADING = 0x00002000L,
WS_EX_STATICEDGE = 0x00020000L,
WS_EX_TOOLWINDOW = 0x00000080L,
WS_EX_TOPMOST = 0x00000008L,
WS_EX_TRANSPARENT = 0x00000020L,
WS_EX_WINDOWEDGE = 0x00000100L,
}
ExtendedWindowStyles.WS_EX_ACCEPTFILES
WS_EX_ACCEPTFILES = 0x00000010L
ExtendedWindowStyles.WS_EX_APPWINDOW
WS_EX_APPWINDOW = 0x00040000L
ExtendedWindowStyles.WS_EX_CLIENTEDGE
WS_EX_CLIENTEDGE = 0x00000200L
ExtendedWindowStyles.WS_EX_COMPOSITED
WS_EX_COMPOSITED = 0x02000000L
ExtendedWindowStyles.WS_EX_CONTEXTHELP
WS_EX_CONTEXTHELP = 0x00000400L
ExtendedWindowStyles.WS_EX_CONTROLPARENT
WS_EX_CONTROLPARENT = 0x00010000L
ExtendedWindowStyles.WS_EX_DLGMODALFRAME
WS_EX_DLGMODALFRAME = 0x00000001L
ExtendedWindowStyles.WS_EX_LAYERED
WS_EX_LAYERED = 0x00080000
ExtendedWindowStyles.WS_EX_LAYOUTRTL
WS_EX_LAYOUTRTL = 0x00400000L
ExtendedWindowStyles.WS_EX_LEFT
WS_EX_LEFT = 0x00000000L
ExtendedWindowStyles.WS_EX_LEFTSCROLLBAR
WS_EX_LEFTSCROLLBAR = 0x00004000L
ExtendedWindowStyles.WS_EX_LTRREADING
WS_EX_LTRREADING = 0x00000000L
ExtendedWindowStyles.WS_EX_MDICHILD
WS_EX_MDICHILD = 0x00000040L
ExtendedWindowStyles.WS_EX_NOACTIVATE
WS_EX_NOACTIVATE = 0x08000000L
ExtendedWindowStyles.WS_EX_NOINHERITLAYOUT
WS_EX_NOINHERITLAYOUT = 0x00100000L
ExtendedWindowStyles.WS_EX_NOPARENTNOTIFY
WS_EX_NOPARENTNOTIFY = 0x00000004L
ExtendedWindowStyles.WS_EX_NOREDIRECTIONBITMAP
WS_EX_NOREDIRECTIONBITMAP = 0x00200000L
ExtendedWindowStyles.WS_EX_OVERLAPPEDWINDOW
WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
ExtendedWindowStyles.WS_EX_PALETTEWINDOW
WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
ExtendedWindowStyles.WS_EX_RIGHT
WS_EX_RIGHT = 0x00001000L
ExtendedWindowStyles.WS_EX_RIGHTSCROLLBAR
WS_EX_RIGHTSCROLLBAR = 0x00000000L
ExtendedWindowStyles.WS_EX_RTLREADING
WS_EX_RTLREADING = 0x00002000L
ExtendedWindowStyles.WS_EX_STATICEDGE
WS_EX_STATICEDGE = 0x00020000L
ExtendedWindowStyles.WS_EX_TOOLWINDOW
WS_EX_TOOLWINDOW = 0x00000080L
ExtendedWindowStyles.WS_EX_TOPMOST
WS_EX_TOPMOST = 0x00000008L
ExtendedWindowStyles.WS_EX_TRANSPARENT
WS_EX_TRANSPARENT = 0x00000020L
ExtendedWindowStyles.WS_EX_WINDOWEDGE
WS_EX_WINDOWEDGE = 0x00000100L
enum User32.HitTest
public enum HitTest : int
{
HTERROR = -2,
HTTRANSPARENT = -1,
HTNOWHERE = 0,
HTCLIENT = 1,
HTCAPTION = 2,
HTSYSMENU = 3,
HTGROWBOX = 4,
HTSIZE = HTGROWBOX,
HTMENU = 5,
HTHSCROLL = 6,
HTVSCROLL = 7,
HTMINBUTTON = 8,
HTMAXBUTTON = 9,
HTLEFT = 10,
HTRIGHT = 11,
HTTOP = 12,
HTTOPLEFT = 13,
HTTOPRIGHT = 14,
HTBOTTOM = 15,
HTBOTTOMLEFT = 16,
HTBOTTOMRIGHT = 17,
HTBORDER = 18,
HTREDUCE = HTMINBUTTON,
HTZOOM = HTMAXBUTTON,
HTSIZEFIRST = HTLEFT,
HTSIZELAST = HTBOTTOMRIGHT,
HTOBJECT = 19,
HTCLOSE = 20,
HTHELP = 21,
}
HitTest.HTBORDER
HTBORDER = 18
HitTest.HTBOTTOM
HTBOTTOM = 15
HitTest.HTBOTTOMLEFT
HTBOTTOMLEFT = 16
HitTest.HTBOTTOMRIGHT
HTBOTTOMRIGHT = 17
HitTest.HTCAPTION
HTCAPTION = 2
HitTest.HTCLIENT
HTCLIENT = 1
HitTest.HTCLOSE
HTCLOSE = 20
HitTest.HTERROR
HTERROR = -2
HitTest.HTGROWBOX
HTGROWBOX = 4
HitTest.HTHELP
HTHELP = 21
HitTest.HTHSCROLL
HTHSCROLL = 6
HitTest.HTLEFT
HTLEFT = 10
HitTest.HTMAXBUTTON
HTMAXBUTTON = 9
HitTest.HTMENU
HTMENU = 5
HitTest.HTMINBUTTON
HTMINBUTTON = 8
HitTest.HTNOWHERE
HTNOWHERE = 0
HitTest.HTOBJECT
HTOBJECT = 19
HitTest.HTREDUCE
HTREDUCE = HTMINBUTTON
HitTest.HTRIGHT
HTRIGHT = 11
HitTest.HTSIZE
HTSIZE = HTGROWBOX
HitTest.HTSIZEFIRST
HTSIZEFIRST = HTLEFT
HitTest.HTSIZELAST
HTSIZELAST = HTBOTTOMRIGHT
HitTest.HTSYSMENU
HTSYSMENU = 3
HitTest.HTTOP
HTTOP = 12
HitTest.HTTOPLEFT
HTTOPLEFT = 13
HitTest.HTTOPRIGHT
HTTOPRIGHT = 14
HitTest.HTTRANSPARENT
HTTRANSPARENT = -1
HitTest.HTVSCROLL
HTVSCROLL = 7
HitTest.HTZOOM
HTZOOM = HTMAXBUTTON
enum User32.LayeredWindowAttribute
[Flags]
public enum LayeredWindowAttribute : long
{
LWA_COLORKEY = 0x00000001,
LWA_ALPHA = 0x00000002,
}
LayeredWindowAttribute.LWA_ALPHA
LWA_ALPHA = 0x00000002
LayeredWindowAttribute.LWA_COLORKEY
LWA_COLORKEY = 0x00000001
struct User32.MSG
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg
[StructLayout(LayoutKind.Sequential)]
public struct MSG
{
public nint hWnd;
public WindowMessage message;
public WPARAM wParam;
public LPARAM lParam;
public DWORD time;
public POINT pt;
public DWORD lPrivate;
}
nint MSG.hWnd
public nint hWnd;
LPARAM MSG.lParam
public LPARAM lParam;
DWORD MSG.lPrivate
public DWORD lPrivate;
WindowMessage MSG.message
public WindowMessage message;
POINT MSG.pt
public POINT pt;
DWORD MSG.time
public DWORD time;
WPARAM MSG.wParam
public WPARAM wParam;
struct User32.NCCALCSIZE_PARAMS
public unsafe struct NCCALCSIZE_PARAMS
{
public RECT r1;
public RECT r2;
public RECT r3;
public WINDOWPOS* lppos;
}
WINDOWPOS* NCCALCSIZE_PARAMS.lppos
public WINDOWPOS* lppos;
RECT NCCALCSIZE_PARAMS.r1
public RECT r1;
RECT NCCALCSIZE_PARAMS.r2
public RECT r2;
RECT NCCALCSIZE_PARAMS.r3
public RECT r3;
struct User32.PAINTSTRUCT
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-paintstruct
[StructLayout(LayoutKind.Explicit, Size = 72)]
public struct PAINTSTRUCT
{
[FieldOffset(0)]
public uint hdc;
[FieldOffset(8)]
public BOOL fErase;
[FieldOffset(12)]
public RECT rcPaint;
[FieldOffset(28)]
public BOOL fRestore;
[FieldOffset(32)]
public BOOL fIncUpdate;
[FieldOffset(36)]
public UInt64 rgbReserved1, rgbReserved2, rgbReserved3, rgbReserved4;
}
BOOL PAINTSTRUCT.fErase
[FieldOffset(8)]
public BOOL fErase;
BOOL PAINTSTRUCT.fIncUpdate
[FieldOffset(32)]
public BOOL fIncUpdate;
BOOL PAINTSTRUCT.fRestore
[FieldOffset(28)]
public BOOL fRestore;
uint PAINTSTRUCT.hdc
[FieldOffset(0)]
public uint hdc;
RECT PAINTSTRUCT.rcPaint
[FieldOffset(12)]
public RECT rcPaint;
ulong PAINTSTRUCT.rgbReserved1
[FieldOffset(36)]
public UInt64 rgbReserved1;
ulong PAINTSTRUCT.rgbReserved2
[FieldOffset(36)]
public UInt64 rgbReserved2;
ulong PAINTSTRUCT.rgbReserved3
[FieldOffset(36)]
public UInt64 rgbReserved3;
ulong PAINTSTRUCT.rgbReserved4
[FieldOffset(36)]
public UInt64 rgbReserved4;
struct User32.POINT
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;
}
int POINT.X
public int X;
int POINT.Y
public int Y;
struct User32.RECT
[StructLayout(LayoutKind.Explicit)]
public struct RECT
{
[FieldOffset(0)]
public int Left;
[FieldOffset(4)]
public int Top;
[FieldOffset(8)]
public int Right;
[FieldOffset(12)]
public int Bottom;
public RECT(Rect rect);
}
RECT.RECT(Rect rect)
public RECT(Rect rect);
int RECT.Bottom
[FieldOffset(12)]
public int Bottom;
int RECT.Left
[FieldOffset(0)]
public int Left;
int RECT.Right
[FieldOffset(8)]
public int Right;
int RECT.Top
[FieldOffset(4)]
public int Top;
enum User32.SystemCursor
public enum SystemCursor : int
{
Arrow = 32512,
IBeam = 32513,
Wait = 32514,
Cross = 32515,
UpArrow = 32516,
SizeNWSE = 32642,
SizeNESW = 32643,
SizeWE = 32644,
SizeNS = 32645,
SizeAll = 32646,
No = 32648,
Hand = 32649,
AppStarting = 32650,
Help = 32651,
}
SystemCursor.AppStarting
AppStarting = 32650
Application starting (arrow + wait) (IDC_APPSTARTING)
SystemCursor.Arrow
Arrow = 32512
Standard arrow cursor (IDC_ARROW)
SystemCursor.Cross
Cross = 32515
Crosshair (IDC_CROSS)
SystemCursor.Hand
Hand = 32649
Hand / link cursor (IDC_HAND)
SystemCursor.Help
Help = 32651
Help cursor (arrow + question) (IDC_HELP)
SystemCursor.IBeam
IBeam = 32513
I-beam text cursor (IDC_IBEAM)
SystemCursor.No
No = 32648
Slashed circle (not allowed) (IDC_NO)
SystemCursor.SizeAll
SizeAll = 32646
Resize all directions (IDC_SIZEALL)
SystemCursor.SizeNESW
SizeNESW = 32643
Resize NE-SW / diagonal (IDC_SIZENESW)
SystemCursor.SizeNS
SizeNS = 32645
Resize vertical (IDC_SIZENS)
SystemCursor.SizeNWSE
SizeNWSE = 32642
Resize NW-SE / diagonal (IDC_SIZENWSE)
SystemCursor.SizeWE
SizeWE = 32644
Resize horizontal (IDC_SIZEWE)
SystemCursor.UpArrow
UpArrow = 32516
Up arrow (rarely used) (IDC_UPARROW)
SystemCursor.Wait
Wait = 32514
Hourglass / wait (legacy) (IDC_WAIT)
enum User32.SystemMetric
public enum SystemMetric : int
{
SM_CYCAPTION = 4,
SM_CXSIZE = 30,
SM_CYSIZE = 31,
SM_CXSIZEFRAME = 32,
SM_CYSIZEFRAME = 33,
SM_CXPADDEDBORDER = 92,
}
SystemMetric.SM_CXPADDEDBORDER
SM_CXPADDEDBORDER = 92
SystemMetric.SM_CXSIZE
SM_CXSIZE = 30
SystemMetric.SM_CXSIZEFRAME
SM_CXSIZEFRAME = 32
SystemMetric.SM_CYCAPTION
SM_CYCAPTION = 4
SystemMetric.SM_CYSIZE
SM_CYSIZE = 31
SystemMetric.SM_CYSIZEFRAME
SM_CYSIZEFRAME = 33
struct User32.TRACKMOUSEEVENT
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-trackmouseevent
[StructLayout(LayoutKind.Explicit, Size = 24)]
public struct TRACKMOUSEEVENT
{
[FieldOffset(0)]
public uint cbSize;
[FieldOffset(4)]
public TrackMouseEventFlags dwFlags;
[FieldOffset(8)]
public HWND hwndTrack;
[FieldOffset(16)]
public uint dwHoverTime;
}
uint TRACKMOUSEEVENT.cbSize
[FieldOffset(0)]
public uint cbSize;
TrackMouseEventFlags TRACKMOUSEEVENT.dwFlags
[FieldOffset(4)]
public TrackMouseEventFlags dwFlags;
uint TRACKMOUSEEVENT.dwHoverTime
[FieldOffset(16)]
public uint dwHoverTime;
HWND TRACKMOUSEEVENT.hwndTrack
[FieldOffset(8)]
public HWND hwndTrack;
enum User32.TrackMouseEventFlags
[Flags]
public enum TrackMouseEventFlags : uint
{
TME_HOVER = 0x00000001,
TME_LEAVE = 0x00000002,
TME_CANCEL = 0x80000000
}
TrackMouseEventFlags.TME_CANCEL
TME_CANCEL = 0x80000000
TrackMouseEventFlags.TME_HOVER
TME_HOVER = 0x00000001
TrackMouseEventFlags.TME_LEAVE
TME_LEAVE = 0x00000002
class User32.Types
public static partial class Types
{
[Flags]
public enum SetWindowPosFlags : uint
{
SWP_NOSIZE = 0x0001,
SWP_NOMOVE = 0x0002,
SWP_NOZORDER = 0x0004,
SWP_NOREDRAW = 0x0008,
SWP_NOACTIVATE = 0x0010,
SWP_FRAMECHANGED = 0x0020,
SWP_SHOWWINDOW = 0x0040,
SWP_HIDEWINDOW = 0x0080,
SWP_NOCOPYBITS = 0x0100,
SWP_NOOWNERZORDER = 0x0200,
SWP_NOSENDCHANGING = 0x0400,
SWP_DEFERERASE = 0x2000,
SWP_ASYNCWINDOWPOS = 0x4000
}
}
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public partial struct HWND : IEquatable<HWND>
{
public static readonly HWND HWND_TOPMOST;
public static readonly HWND HWND_NOTOPMOST;
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ShowWindow(HWND hWnd, int nCmdShow);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool UpdateWindow(HWND hWnd);
[LibraryImport(User32Lib, EntryPoint = "SetWindowTextW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpString);
[LibraryImport(User32Lib, EntryPoint = "GetWindowTextW")]
public static partial int GetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] out string lpString, int maxLength);
[LibraryImport(User32Lib, EntryPoint = "SetWindowPos")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, Types.SetWindowPosFlags uFlags);
[LibraryImport(User32Lib, EntryPoint = "GetClientRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetClientRect(HWND hWnd, out RECT rc);
[LibraryImport(User32Lib, EntryPoint = "DefWindowProcW")]
public static partial LRESULT DefWindowProc(HWND hWnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, ref RECT rect, [MarshalAs(UnmanagedType.Bool)] bool erase);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, nint rectPtr, [MarshalAs(UnmanagedType.Bool)] bool erase);
[LibraryImport(User32Lib)]
public static partial HDC BeginPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
[LibraryImport(User32Lib)]
public static partial BOOL EndPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
[LibraryImport(User32Lib)]
public static partial BOOL ScreenToClient(HWND hWnd, ref POINT lpPoint);
[LibraryImport(User32Lib)]
public static partial uint GetDpiForWindow(HWND hwnd);
[LibraryImport(User32Lib, EntryPoint = "SetCapture")]
public static partial HWND SetCapture(HWND hWnd);
[LibraryImport(User32Lib, EntryPoint = "ReleaseCapture")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReleaseCapture();
[LibraryImport(User32Lib, EntryPoint = "GetWindowRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetWindowRect(HWND hWnd, out RECT lpRect);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool IsZoomed(HWND hWnd);
public nint value;
public HWND(nint value);
public bool SetWindowText(string text);
public int GetWindowText(out string text, int maxLength);
public bool GetClientRect(out RECT rect);
public void ShowWindow(int nCmdShow = 1);
public bool UpdateWindow();
public void Invalidate();
public bool ScreenToClient(ref POINT point);
public bool GetWindowRect(out RECT rect);
public bool IsMaximized { get; }
public LRESULT DefWindowProc(WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
public HDC BeginPaint(ref PAINTSTRUCT lpPaint);
public bool EndPaint(ref PAINTSTRUCT lpPaint);
public nint Value { get; }
public bool Equals(HWND other);
public override bool Equals(object? obj);
public override int GetHashCode();
public static bool operator ==(HWND left, HWND right);
public static bool operator !=(HWND left, HWND right);
public uint DPI { get; }
public NFloat DPIScale { get; }
public HWND CaptureMouse();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator nint(HWND v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator HWND(nint v);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool ShowWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, int nCmdShow);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool UpdateWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool SetWindowText(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, string lpString);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial int GetWindowText(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out string lpString, int maxLength);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool SetWindowPos(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWndInsertAfter, int X, int Y, int cx, int cy, global::Xui.Runtime.Windows.Win32.User32.Types.SetWindowPosFlags uFlags);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetClientRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out global::Xui.Runtime.Windows.Win32.User32.RECT rc);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "DefWindowProcW", ExactSpelling = true)]
public static extern partial global::Xui.Runtime.Windows.Win32.Types.LRESULT DefWindowProc(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.User32.WindowMessage uMsg, global::Xui.Runtime.Windows.Win32.Types.WPARAM wParam, global::Xui.Runtime.Windows.Win32.Types.LPARAM lParam);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool InvalidateRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.RECT rect, bool erase);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool InvalidateRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, nint rectPtr, bool erase);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.HDC BeginPaint(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.PAINTSTRUCT lpPaint);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL EndPaint(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.PAINTSTRUCT lpPaint);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL ScreenToClient(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.POINT lpPoint);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetDpiForWindow", ExactSpelling = true)]
public static extern partial uint GetDpiForWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hwnd);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCapture", ExactSpelling = true)]
public static extern partial global::Xui.Runtime.Windows.Win32.User32.Types.HWND SetCapture(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool ReleaseCapture();
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetWindowRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out global::Xui.Runtime.Windows.Win32.User32.RECT lpRect);
}
}
public static unsafe partial class Types
{
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool IsZoomed(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
}
struct User32.Types.HWND
[DebuggerDisplay("{Value}")]
public partial struct HWND : IEquatable<HWND>
{
public static readonly HWND HWND_TOPMOST;
public static readonly HWND HWND_NOTOPMOST;
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ShowWindow(HWND hWnd, int nCmdShow);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool UpdateWindow(HWND hWnd);
[LibraryImport(User32Lib, EntryPoint = "SetWindowTextW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpString);
[LibraryImport(User32Lib, EntryPoint = "GetWindowTextW")]
public static partial int GetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] out string lpString, int maxLength);
[LibraryImport(User32Lib, EntryPoint = "SetWindowPos")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, Types.SetWindowPosFlags uFlags);
[LibraryImport(User32Lib, EntryPoint = "GetClientRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetClientRect(HWND hWnd, out RECT rc);
[LibraryImport(User32Lib, EntryPoint = "DefWindowProcW")]
public static partial LRESULT DefWindowProc(HWND hWnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, ref RECT rect, [MarshalAs(UnmanagedType.Bool)] bool erase);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, nint rectPtr, [MarshalAs(UnmanagedType.Bool)] bool erase);
[LibraryImport(User32Lib)]
public static partial HDC BeginPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
[LibraryImport(User32Lib)]
public static partial BOOL EndPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
[LibraryImport(User32Lib)]
public static partial BOOL ScreenToClient(HWND hWnd, ref POINT lpPoint);
[LibraryImport(User32Lib)]
public static partial uint GetDpiForWindow(HWND hwnd);
[LibraryImport(User32Lib, EntryPoint = "SetCapture")]
public static partial HWND SetCapture(HWND hWnd);
[LibraryImport(User32Lib, EntryPoint = "ReleaseCapture")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReleaseCapture();
[LibraryImport(User32Lib, EntryPoint = "GetWindowRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetWindowRect(HWND hWnd, out RECT lpRect);
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool IsZoomed(HWND hWnd);
public nint value;
public HWND(nint value);
public bool SetWindowText(string text);
public int GetWindowText(out string text, int maxLength);
public bool GetClientRect(out RECT rect);
public void ShowWindow(int nCmdShow = 1);
public bool UpdateWindow();
public void Invalidate();
public bool ScreenToClient(ref POINT point);
public bool GetWindowRect(out RECT rect);
public bool IsMaximized { get; }
public LRESULT DefWindowProc(WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
public HDC BeginPaint(ref PAINTSTRUCT lpPaint);
public bool EndPaint(ref PAINTSTRUCT lpPaint);
public nint Value { get; }
public bool Equals(HWND other);
public override bool Equals(object? obj);
public override int GetHashCode();
public static bool operator ==(HWND left, HWND right);
public static bool operator !=(HWND left, HWND right);
public uint DPI { get; }
public NFloat DPIScale { get; }
public HWND CaptureMouse();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator nint(HWND v);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator HWND(nint v);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool ShowWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, int nCmdShow);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool UpdateWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool SetWindowText(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, string lpString);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial int GetWindowText(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out string lpString, int maxLength);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool SetWindowPos(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWndInsertAfter, int X, int Y, int cx, int cy, global::Xui.Runtime.Windows.Win32.User32.Types.SetWindowPosFlags uFlags);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetClientRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out global::Xui.Runtime.Windows.Win32.User32.RECT rc);
}
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "DefWindowProcW", ExactSpelling = true)]
public static extern partial global::Xui.Runtime.Windows.Win32.Types.LRESULT DefWindowProc(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, global::Xui.Runtime.Windows.Win32.User32.WindowMessage uMsg, global::Xui.Runtime.Windows.Win32.Types.WPARAM wParam, global::Xui.Runtime.Windows.Win32.Types.LPARAM lParam);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool InvalidateRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.RECT rect, bool erase);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool InvalidateRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, nint rectPtr, bool erase);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.HDC BeginPaint(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.PAINTSTRUCT lpPaint);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL EndPaint(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.PAINTSTRUCT lpPaint);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial global::Xui.Runtime.Windows.Win32.Types.BOOL ScreenToClient(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, ref global::Xui.Runtime.Windows.Win32.User32.POINT lpPoint);
}
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetDpiForWindow", ExactSpelling = true)]
public static extern partial uint GetDpiForWindow(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hwnd);
}
public unsafe partial struct HWND
{
[global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCapture", ExactSpelling = true)]
public static extern partial global::Xui.Runtime.Windows.Win32.User32.Types.HWND SetCapture(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool ReleaseCapture();
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool GetWindowRect(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd, out global::Xui.Runtime.Windows.Win32.User32.RECT lpRect);
}
public unsafe partial struct HWND
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "10.0.15.3008")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
public static partial bool IsZoomed(global::Xui.Runtime.Windows.Win32.User32.Types.HWND hWnd);
}
HWND.HWND(nint value)
public HWND(nint value);
HDC HWND.BeginPaint(ref PAINTSTRUCT lpPaint)
public HDC BeginPaint(ref PAINTSTRUCT lpPaint);
HDC HWND.BeginPaint(HWND hWnd, ref PAINTSTRUCT lpPaint)
[LibraryImport(User32Lib)]
public static partial HDC BeginPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
HWND HWND.CaptureMouse()
public HWND CaptureMouse();
uint HWND.DPI
public uint DPI { get; }
Gets the DPI scale for this window. 1.0 = 100% DPI (96 DPI), 2.0 = 200% DPI (192 DPI).
NFloat HWND.DPIScale
public NFloat DPIScale { get; }
LRESULT HWND.DefWindowProc(HWND hWnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam)
[LibraryImport(User32Lib, EntryPoint = "DefWindowProcW")]
public static partial LRESULT DefWindowProc(HWND hWnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
LRESULT HWND.DefWindowProc(WindowMessage uMsg, WPARAM wParam, LPARAM lParam)
public LRESULT DefWindowProc(WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
bool HWND.EndPaint(ref PAINTSTRUCT lpPaint)
public bool EndPaint(ref PAINTSTRUCT lpPaint);
BOOL HWND.EndPaint(HWND hWnd, ref PAINTSTRUCT lpPaint)
[LibraryImport(User32Lib)]
public static partial BOOL EndPaint(HWND hWnd, ref PAINTSTRUCT lpPaint);
bool HWND.Equals(object? obj)
public override bool Equals(object? obj);
bool HWND.Equals(HWND other)
public bool Equals(HWND other);
bool HWND.GetClientRect(out RECT rect)
public bool GetClientRect(out RECT rect);
bool HWND.GetClientRect(HWND hWnd, out RECT rc)
[LibraryImport(User32Lib, EntryPoint = "GetClientRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetClientRect(HWND hWnd, out RECT rc);
uint HWND.GetDpiForWindow(HWND hwnd)
[LibraryImport(User32Lib)]
public static partial uint GetDpiForWindow(HWND hwnd);
int HWND.GetHashCode()
public override int GetHashCode();
bool HWND.GetWindowRect(out RECT rect)
public bool GetWindowRect(out RECT rect);
bool HWND.GetWindowRect(HWND hWnd, out RECT lpRect)
[LibraryImport(User32Lib, EntryPoint = "GetWindowRect")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetWindowRect(HWND hWnd, out RECT lpRect);
int HWND.GetWindowText(out string text, int maxLength)
public int GetWindowText(out string text, int maxLength);
int HWND.GetWindowText(HWND hWnd, out string lpString, int maxLength)
[LibraryImport(User32Lib, EntryPoint = "GetWindowTextW")]
public static partial int GetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] out string lpString, int maxLength);
HWND HWND.HWND_NOTOPMOST
public static readonly HWND HWND_NOTOPMOST;
HWND HWND.HWND_TOPMOST
public static readonly HWND HWND_TOPMOST;
void HWND.Invalidate()
public void Invalidate();
bool HWND.InvalidateRect(HWND hWnd, nint rectPtr, bool erase)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, nint rectPtr, [MarshalAs(UnmanagedType.Bool)] bool erase);
bool HWND.InvalidateRect(HWND hWnd, ref RECT rect, bool erase)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool InvalidateRect(HWND hWnd, ref RECT rect, [MarshalAs(UnmanagedType.Bool)] bool erase);
bool HWND.IsMaximized
public bool IsMaximized { get; }
bool HWND.IsZoomed(HWND hWnd)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool IsZoomed(HWND hWnd);
bool HWND.ReleaseCapture()
[LibraryImport(User32Lib, EntryPoint = "ReleaseCapture")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReleaseCapture();
bool HWND.ScreenToClient(ref POINT point)
public bool ScreenToClient(ref POINT point);
BOOL HWND.ScreenToClient(HWND hWnd, ref POINT lpPoint)
[LibraryImport(User32Lib)]
public static partial BOOL ScreenToClient(HWND hWnd, ref POINT lpPoint);
HWND HWND.SetCapture(HWND hWnd)
[LibraryImport(User32Lib, EntryPoint = "SetCapture")]
public static partial HWND SetCapture(HWND hWnd);
bool HWND.SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags)
[LibraryImport(User32Lib, EntryPoint = "SetWindowPos")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, Types.SetWindowPosFlags uFlags);
bool HWND.SetWindowText(string text)
public bool SetWindowText(string text);
bool HWND.SetWindowText(HWND hWnd, string lpString)
[LibraryImport(User32Lib, EntryPoint = "SetWindowTextW")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetWindowText(HWND hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpString);
void HWND.ShowWindow(int nCmdShow = 1)
public void ShowWindow(int nCmdShow = 1);
bool HWND.ShowWindow(HWND hWnd, int nCmdShow)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ShowWindow(HWND hWnd, int nCmdShow);
bool HWND.UpdateWindow()
public bool UpdateWindow();
bool HWND.UpdateWindow(HWND hWnd)
[LibraryImport(User32Lib)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool UpdateWindow(HWND hWnd);
nint HWND.Value
public nint Value { get; }
bool HWND.operator ==(HWND left, HWND right)
public static bool operator ==(HWND left, HWND right);
HWND.implicit operator HWND(nint v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator HWND(nint v);
HWND.implicit operator nint(HWND v)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator nint(HWND v);
bool HWND.operator !=(HWND left, HWND right)
public static bool operator !=(HWND left, HWND right);
nint HWND.value
public nint value;
enum User32.Types.SetWindowPosFlags
[Flags]
public enum SetWindowPosFlags : uint
{
SWP_NOSIZE = 0x0001,
SWP_NOMOVE = 0x0002,
SWP_NOZORDER = 0x0004,
SWP_NOREDRAW = 0x0008,
SWP_NOACTIVATE = 0x0010,
SWP_FRAMECHANGED = 0x0020,
SWP_SHOWWINDOW = 0x0040,
SWP_HIDEWINDOW = 0x0080,
SWP_NOCOPYBITS = 0x0100,
SWP_NOOWNERZORDER = 0x0200,
SWP_NOSENDCHANGING = 0x0400,
SWP_DEFERERASE = 0x2000,
SWP_ASYNCWINDOWPOS = 0x4000
}
SetWindowPosFlags.SWP_ASYNCWINDOWPOS
SWP_ASYNCWINDOWPOS = 0x4000
SetWindowPosFlags.SWP_DEFERERASE
SWP_DEFERERASE = 0x2000
SetWindowPosFlags.SWP_FRAMECHANGED
SWP_FRAMECHANGED = 0x0020
SetWindowPosFlags.SWP_HIDEWINDOW
SWP_HIDEWINDOW = 0x0080
SetWindowPosFlags.SWP_NOACTIVATE
SWP_NOACTIVATE = 0x0010
SetWindowPosFlags.SWP_NOCOPYBITS
SWP_NOCOPYBITS = 0x0100
SetWindowPosFlags.SWP_NOMOVE
SWP_NOMOVE = 0x0002
SetWindowPosFlags.SWP_NOOWNERZORDER
SWP_NOOWNERZORDER = 0x0200
SetWindowPosFlags.SWP_NOREDRAW
SWP_NOREDRAW = 0x0008
SetWindowPosFlags.SWP_NOSENDCHANGING
SWP_NOSENDCHANGING = 0x0400
SetWindowPosFlags.SWP_NOSIZE
SWP_NOSIZE = 0x0001
SetWindowPosFlags.SWP_NOZORDER
SWP_NOZORDER = 0x0004
SetWindowPosFlags.SWP_SHOWWINDOW
SWP_SHOWWINDOW = 0x0040
struct User32.WINDOWPOS
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
{
public nint hwnd;
public nint hwndInsertAfter;
public int x;
public int y;
public int cx;
public int cy;
public uint flags;
}
int WINDOWPOS.cx
public int cx;
int WINDOWPOS.cy
public int cy;
uint WINDOWPOS.flags
public uint flags;
nint WINDOWPOS.hwnd
public nint hwnd;
nint WINDOWPOS.hwndInsertAfter
public nint hwndInsertAfter;
int WINDOWPOS.x
public int x;
int WINDOWPOS.y
public int y;
struct User32.WNDCLASSEXW
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-wndclassexa
[StructLayout(LayoutKind.Sequential)]
public struct WNDCLASSEXW
{
public uint cbSize;
public WindowClassStyles styles;
public nint lpfnWndProc;
public int cbClsExtra;
public int cbWndExtra;
public nint hInstance;
public nint hIcon;
public nint hCursor;
public nint hbrBackground;
public nint lpszMenuName;
public nint lpszClassName;
public nint hIconSm;
}
int WNDCLASSEXW.cbClsExtra
public int cbClsExtra;
uint WNDCLASSEXW.cbSize
public uint cbSize;
int WNDCLASSEXW.cbWndExtra
public int cbWndExtra;
nint WNDCLASSEXW.hCursor
public nint hCursor;
nint WNDCLASSEXW.hIcon
public nint hIcon;
nint WNDCLASSEXW.hIconSm
public nint hIconSm;
nint WNDCLASSEXW.hInstance
public nint hInstance;
nint WNDCLASSEXW.hbrBackground
public nint hbrBackground;
nint WNDCLASSEXW.lpfnWndProc
public nint lpfnWndProc;
nint WNDCLASSEXW.lpszClassName
public nint lpszClassName;
nint WNDCLASSEXW.lpszMenuName
public nint lpszMenuName;
WindowClassStyles WNDCLASSEXW.styles
public WindowClassStyles styles;
delegate User32.WNDPROC
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate int WNDPROC(HWND hwnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
enum User32.WindowClassStyles
https://learn.microsoft.com/en-us/windows/win32/winmsg/window-class-styles#constants
[Flags]
public enum WindowClassStyles : uint
{
CS_BYTEALIGNCLIENT = 0x1000,
CS_BYTEALIGNWINDOW = 0x2000,
CS_CLASSDC = 0x0040,
CS_DBLCLKS = 0x0008,
CS_DROPSHADOW = 0x00020000,
CS_GLOBALCLASS = 0x4000,
CS_HREDRAW = 0x0002,
CS_NOCLOSE = 0x0200,
CS_OWNDC = 0x0020,
CS_PARENTDC = 0x0080,
CS_SAVEBITS = 0x0800,
CS_VREDRAW = 0x0001,
}
WindowClassStyles.CS_BYTEALIGNCLIENT
CS_BYTEALIGNCLIENT = 0x1000
WindowClassStyles.CS_BYTEALIGNWINDOW
CS_BYTEALIGNWINDOW = 0x2000
WindowClassStyles.CS_CLASSDC
CS_CLASSDC = 0x0040
WindowClassStyles.CS_DBLCLKS
CS_DBLCLKS = 0x0008
WindowClassStyles.CS_DROPSHADOW
CS_DROPSHADOW = 0x00020000
WindowClassStyles.CS_GLOBALCLASS
CS_GLOBALCLASS = 0x4000
WindowClassStyles.CS_HREDRAW
CS_HREDRAW = 0x0002
WindowClassStyles.CS_NOCLOSE
CS_NOCLOSE = 0x0200
WindowClassStyles.CS_OWNDC
CS_OWNDC = 0x0020
WindowClassStyles.CS_PARENTDC
CS_PARENTDC = 0x0080
WindowClassStyles.CS_SAVEBITS
CS_SAVEBITS = 0x0800
WindowClassStyles.CS_VREDRAW
CS_VREDRAW = 0x0001
enum User32.WindowColor
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsyscolor#parameters
public enum WindowColor : int
{
COLOR_WINDOW = 5,
COLOR_3DFACE = 15
}
WindowColor.COLOR_3DFACE
COLOR_3DFACE = 15
WindowColor.COLOR_WINDOW
COLOR_WINDOW = 5
enum User32.WindowMessage
https://learn.microsoft.com/en-us/windows/win32/winmsg/about-messages-and-message-queues#system-defined-messages
public enum WindowMessage : uint
{
WM_NULL = 0x0000,
WM_CREATE = 0x0001,
WM_DESTROY = 0x0002,
WM_MOVE = 0x0003,
WM_SIZE = 0x0005,
WM_ERASEBKGND = 0x0014,
WM_SETCURSOR = 0x0020,
WM_ACTIVATEAPP = 0x001C,
WM_CANCELMODE = 0x001F,
WM_CHILDACTIVATE = 0x0022,
WM_CLOSE = 0x0010,
WM_COMPACTING = 0x0041,
WM_ENABLE = 0x000A,
WM_ENTERSIZEMOVE = 0x0231,
WM_EXITSIZEMOVE = 0x0232,
WM_GETICON = 0x007F,
WM_GETMINMAXINFO = 0x0024,
WM_INPUTLANGCHANGE = 0x0051,
WM_INPUTLANGCHANGEREQUEST = 0x0050,
WM_MOVING = 0x0216,
WM_NCACTIVATE = 0x0086,
WM_NCCALCSIZE = 0x0083,
WM_NCCREATE = 0x0081,
WM_NCDESTROY = 0x0082,
WM_QUERYDRAGICON = 0x0037,
WM_QUERYOPEN = 0x0013,
WM_QUIT = 0x0012,
WM_SHOWWINDOW = 0x0018,
WM_SIZING = 0x0214,
WM_STYLECHANGED = 0x007D,
WM_STYLECHANGING = 0x007C,
WM_THEMECHANGED = 0x031A,
WM_USERCHANGED = 0x0054,
WM_WINDOWPOSCHANGED = 0x0047,
WM_WINDOWPOSCHANGING = 0x0046,
WM_CAPTURECHANGED = 0x0215,
WM_LBUTTONDBLCLK = 0x0203,
WM_LBUTTONDOWN = 0x0201,
WM_LBUTTONUP = 0x0202,
WM_MBUTTONDBLCLK = 0x0209,
WM_MBUTTONDOWN = 0x0207,
WM_MBUTTONUP = 0x0208,
WM_MOUSEACTIVATE = 0x0021,
WM_MOUSEHOVER = 0x02A1,
WM_MOUSEHWHEEL = 0x020E,
WM_MOUSELEAVE = 0x02A3,
WM_MOUSEMOVE = 0x0200,
WM_MOUSEWHEEL = 0x020A,
WM_NCHITTEST = 0x0084,
WM_NCLBUTTONDBLCLK = 0x00A3,
WM_NCLBUTTONDOWN = 0x00A1,
WM_NCLBUTTONUP = 0x00A2,
WM_NCMBUTTONDBLCLK = 0x00A9,
WM_NCMBUTTONDOWN = 0x00A7,
WM_NCMBUTTONUP = 0x00A8,
WM_NCMOUSEHOVER = 0x02A0,
WM_NCMOUSELEAVE = 0x02A2,
WM_NCMOUSEMOVE = 0x00A0,
WM_NCRBUTTONDBLCLK = 0x00A6,
WM_NCRBUTTONDOWN = 0x00A4,
WM_NCRBUTTONUP = 0x00A5,
WM_NCXBUTTONDBLCLK = 0x00AD,
WM_NCXBUTTONDOWN = 0x00AB,
WM_NCXBUTTONUP = 0x00AC,
WM_RBUTTONDBLCLK = 0x0206,
WM_RBUTTONDOWN = 0x0204,
WM_RBUTTONUP = 0x0205,
WM_XBUTTONDBLCLK = 0x020D,
WM_XBUTTONDOWN = 0x020B,
WM_XBUTTONUP = 0x020C,
WM_ACTIVATE = 0x0006,
WM_APPCOMMAND = 0x0319,
WM_CHAR = 0x0102,
WM_DEADCHAR = 0x0103,
WM_HOTKEY = 0x0312,
WM_KEYDOWN = 0x0100,
WM_KEYUP = 0x0101,
WM_KILLFOCUS = 0x0008,
WM_SETFOCUS = 0x0007,
WM_SYSDEADCHAR = 0x0107,
WM_SYSKEYDOWN = 0x0104,
WM_SYSKEYUP = 0x0105,
WM_UNICHAR = 0x0109,
WM_DISPLAYCHANGE = 0x7E,
WM_NCPAINT = 0x85,
WM_PAINT = 0xF,
WM_PRINT = 0x317,
WM_PRINTCLIENT = 0x318,
WM_SETREDRAW = 0xB,
WM_SYNCPAINT = 0x88,
WM_INITMENUPOPUP = 0x0117,
WM_MENUCHAR = 0x0120,
WM_MENUSELECT = 0x011F,
WM_SYSCHAR = 0x0106,
WM_SYSCOMMAND = 0x0112,
WM_TIMER = 0x0113,
WM_DPICHANGED = 0x02E0,
WM_SETICON = 0x0080,
}
WindowMessage.WM_ACTIVATE
WM_ACTIVATE = 0x0006
WindowMessage.WM_ACTIVATEAPP
WM_ACTIVATEAPP = 0x001C
WindowMessage.WM_APPCOMMAND
WM_APPCOMMAND = 0x0319
WindowMessage.WM_CANCELMODE
WM_CANCELMODE = 0x001F
WindowMessage.WM_CAPTURECHANGED
WM_CAPTURECHANGED = 0x0215
WindowMessage.WM_CHAR
WM_CHAR = 0x0102
WindowMessage.WM_CHILDACTIVATE
WM_CHILDACTIVATE = 0x0022
WindowMessage.WM_CLOSE
WM_CLOSE = 0x0010
WindowMessage.WM_COMPACTING
WM_COMPACTING = 0x0041
WindowMessage.WM_CREATE
WM_CREATE = 0x0001
WindowMessage.WM_DEADCHAR
WM_DEADCHAR = 0x0103
WindowMessage.WM_DESTROY
WM_DESTROY = 0x0002
WindowMessage.WM_DISPLAYCHANGE
WM_DISPLAYCHANGE = 0x7E
WindowMessage.WM_DPICHANGED
WM_DPICHANGED = 0x02E0
WindowMessage.WM_ENABLE
WM_ENABLE = 0x000A
WindowMessage.WM_ENTERSIZEMOVE
WM_ENTERSIZEMOVE = 0x0231
WindowMessage.WM_ERASEBKGND
WM_ERASEBKGND = 0x0014
WindowMessage.WM_EXITSIZEMOVE
WM_EXITSIZEMOVE = 0x0232
WindowMessage.WM_GETICON
WM_GETICON = 0x007F
WindowMessage.WM_GETMINMAXINFO
WM_GETMINMAXINFO = 0x0024
WindowMessage.WM_HOTKEY
WM_HOTKEY = 0x0312
WindowMessage.WM_INITMENUPOPUP
WM_INITMENUPOPUP = 0x0117
WindowMessage.WM_INPUTLANGCHANGE
WM_INPUTLANGCHANGE = 0x0051
WindowMessage.WM_INPUTLANGCHANGEREQUEST
WM_INPUTLANGCHANGEREQUEST = 0x0050
WindowMessage.WM_KEYDOWN
WM_KEYDOWN = 0x0100
WindowMessage.WM_KEYUP
WM_KEYUP = 0x0101
WindowMessage.WM_KILLFOCUS
WM_KILLFOCUS = 0x0008
WindowMessage.WM_LBUTTONDBLCLK
WM_LBUTTONDBLCLK = 0x0203
WindowMessage.WM_LBUTTONDOWN
WM_LBUTTONDOWN = 0x0201
WindowMessage.WM_LBUTTONUP
WM_LBUTTONUP = 0x0202
WindowMessage.WM_MBUTTONDBLCLK
WM_MBUTTONDBLCLK = 0x0209
WindowMessage.WM_MBUTTONDOWN
WM_MBUTTONDOWN = 0x0207
WindowMessage.WM_MBUTTONUP
WM_MBUTTONUP = 0x0208
WindowMessage.WM_MENUCHAR
WM_MENUCHAR = 0x0120
WindowMessage.WM_MENUSELECT
WM_MENUSELECT = 0x011F
WindowMessage.WM_MOUSEACTIVATE
WM_MOUSEACTIVATE = 0x0021
WindowMessage.WM_MOUSEHOVER
WM_MOUSEHOVER = 0x02A1
WindowMessage.WM_MOUSEHWHEEL
WM_MOUSEHWHEEL = 0x020E
WindowMessage.WM_MOUSELEAVE
WM_MOUSELEAVE = 0x02A3
WindowMessage.WM_MOUSEMOVE
WM_MOUSEMOVE = 0x0200
WindowMessage.WM_MOUSEWHEEL
WM_MOUSEWHEEL = 0x020A
WindowMessage.WM_MOVE
WM_MOVE = 0x0003
WindowMessage.WM_MOVING
WM_MOVING = 0x0216
WindowMessage.WM_NCACTIVATE
WM_NCACTIVATE = 0x0086
WindowMessage.WM_NCCALCSIZE
WM_NCCALCSIZE = 0x0083
WindowMessage.WM_NCCREATE
WM_NCCREATE = 0x0081
WindowMessage.WM_NCDESTROY
WM_NCDESTROY = 0x0082
WindowMessage.WM_NCHITTEST
WM_NCHITTEST = 0x0084
WindowMessage.WM_NCLBUTTONDBLCLK
WM_NCLBUTTONDBLCLK = 0x00A3
WindowMessage.WM_NCLBUTTONDOWN
WM_NCLBUTTONDOWN = 0x00A1
WindowMessage.WM_NCLBUTTONUP
WM_NCLBUTTONUP = 0x00A2
WindowMessage.WM_NCMBUTTONDBLCLK
WM_NCMBUTTONDBLCLK = 0x00A9
WindowMessage.WM_NCMBUTTONDOWN
WM_NCMBUTTONDOWN = 0x00A7
WindowMessage.WM_NCMBUTTONUP
WM_NCMBUTTONUP = 0x00A8
WindowMessage.WM_NCMOUSEHOVER
WM_NCMOUSEHOVER = 0x02A0
WindowMessage.WM_NCMOUSELEAVE
WM_NCMOUSELEAVE = 0x02A2
WindowMessage.WM_NCMOUSEMOVE
WM_NCMOUSEMOVE = 0x00A0
WindowMessage.WM_NCPAINT
WM_NCPAINT = 0x85
WindowMessage.WM_NCRBUTTONDBLCLK
WM_NCRBUTTONDBLCLK = 0x00A6
WindowMessage.WM_NCRBUTTONDOWN
WM_NCRBUTTONDOWN = 0x00A4
WindowMessage.WM_NCRBUTTONUP
WM_NCRBUTTONUP = 0x00A5
WindowMessage.WM_NCXBUTTONDBLCLK
WM_NCXBUTTONDBLCLK = 0x00AD
WindowMessage.WM_NCXBUTTONDOWN
WM_NCXBUTTONDOWN = 0x00AB
WindowMessage.WM_NCXBUTTONUP
WM_NCXBUTTONUP = 0x00AC
WindowMessage.WM_NULL
WM_NULL = 0x0000
WindowMessage.WM_PAINT
WM_PAINT = 0xF
WindowMessage.WM_PRINT
WM_PRINT = 0x317
WindowMessage.WM_PRINTCLIENT
WM_PRINTCLIENT = 0x318
WindowMessage.WM_QUERYDRAGICON
WM_QUERYDRAGICON = 0x0037
WindowMessage.WM_QUERYOPEN
WM_QUERYOPEN = 0x0013
WindowMessage.WM_QUIT
WM_QUIT = 0x0012
WindowMessage.WM_RBUTTONDBLCLK
WM_RBUTTONDBLCLK = 0x0206
WindowMessage.WM_RBUTTONDOWN
WM_RBUTTONDOWN = 0x0204
WindowMessage.WM_RBUTTONUP
WM_RBUTTONUP = 0x0205
WindowMessage.WM_SETCURSOR
WM_SETCURSOR = 0x0020
WindowMessage.WM_SETFOCUS
WM_SETFOCUS = 0x0007
WindowMessage.WM_SETICON
WM_SETICON = 0x0080
WindowMessage.WM_SETREDRAW
WM_SETREDRAW = 0xB
WindowMessage.WM_SHOWWINDOW
WM_SHOWWINDOW = 0x0018
WindowMessage.WM_SIZE
WM_SIZE = 0x0005
WindowMessage.WM_SIZING
WM_SIZING = 0x0214
WindowMessage.WM_STYLECHANGED
WM_STYLECHANGED = 0x007D
WindowMessage.WM_STYLECHANGING
WM_STYLECHANGING = 0x007C
WindowMessage.WM_SYNCPAINT
WM_SYNCPAINT = 0x88
WindowMessage.WM_SYSCHAR
WM_SYSCHAR = 0x0106
WindowMessage.WM_SYSCOMMAND
WM_SYSCOMMAND = 0x0112
WindowMessage.WM_SYSDEADCHAR
WM_SYSDEADCHAR = 0x0107
WindowMessage.WM_SYSKEYDOWN
WM_SYSKEYDOWN = 0x0104
WindowMessage.WM_SYSKEYUP
WM_SYSKEYUP = 0x0105
WindowMessage.WM_THEMECHANGED
WM_THEMECHANGED = 0x031A
WindowMessage.WM_TIMER
WM_TIMER = 0x0113
WindowMessage.WM_UNICHAR
WM_UNICHAR = 0x0109
WindowMessage.WM_USERCHANGED
WM_USERCHANGED = 0x0054
WindowMessage.WM_WINDOWPOSCHANGED
WM_WINDOWPOSCHANGED = 0x0047
WindowMessage.WM_WINDOWPOSCHANGING
WM_WINDOWPOSCHANGING = 0x0046
WindowMessage.WM_XBUTTONDBLCLK
WM_XBUTTONDBLCLK = 0x020D
WindowMessage.WM_XBUTTONDOWN
WM_XBUTTONDOWN = 0x020B
WindowMessage.WM_XBUTTONUP
WM_XBUTTONUP = 0x020C
enum User32.WindowPosFlags
[Flags]
public enum WindowPosFlags : uint
{
None = 0,
NoSize = 0x0001,
NoMove = 0x0002,
NoZOrder = 0x0004,
NoRedraw = 0x0008,
NoActivate = 0x0010,
FrameChanged = 0x0020,
ShowWindow = 0x0040,
HideWindow = 0x0080,
NoCopyBits = 0x0100,
NoOwnerZOrder = 0x0200,
NoSendChanging = 0x0400,
DeferErase = 0x2000,
AsyncWindowPos = 0x4000,
}
WindowPosFlags.AsyncWindowPos
AsyncWindowPos = 0x4000
WindowPosFlags.DeferErase
DeferErase = 0x2000
WindowPosFlags.FrameChanged
FrameChanged = 0x0020
WindowPosFlags.HideWindow
HideWindow = 0x0080
WindowPosFlags.NoActivate
NoActivate = 0x0010
WindowPosFlags.NoCopyBits
NoCopyBits = 0x0100
WindowPosFlags.NoMove
NoMove = 0x0002
WindowPosFlags.NoOwnerZOrder
NoOwnerZOrder = 0x0200
WindowPosFlags.NoRedraw
NoRedraw = 0x0008
WindowPosFlags.NoSendChanging
NoSendChanging = 0x0400
WindowPosFlags.NoSize
NoSize = 0x0001
WindowPosFlags.NoZOrder
NoZOrder = 0x0004
WindowPosFlags.None
None = 0
WindowPosFlags.ShowWindow
ShowWindow = 0x0040
enum User32.WindowStyles
https://learn.microsoft.com/en-us/windows/win32/winmsg/window-class-styles#constants
[Flags]
public enum WindowStyles : long
{
WS_BORDER = 0x00800000L,
WS_CAPTION = 0x00C00000L,
WS_CHILD = 0x40000000L,
WS_CHILDWINDOW = 0x40000000L,
WS_CLIPCHILDREN = 0x02000000L,
WS_CLIPSIBLINGS = 0x04000000L,
WS_DISABLED = 0x08000000L,
WS_DLGFRAME = 0x00400000L,
WS_GROUP = 0x00020000L,
WS_HSCROLL = 0x00100000L,
WS_ICONIC = 0x20000000L,
WS_MAXIMIZE = 0x01000000L,
WS_MAXIMIZEBOX = 0x00010000L,
WS_MINIMIZE = 0x20000000L,
WS_MINIMIZEBOX = 0x00020000L,
WS_OVERLAPPED = 0x00000000L,
WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX),
WS_POPUP = 0x80000000L,
WS_POPUPWINDOW = (WS_POPUP | WS_BORDER | WS_SYSMENU),
WS_SIZEBOX = 0x00040000L,
WS_SYSMENU = 0x00080000L,
WS_TABSTOP = 0x00010000L,
WS_THICKFRAME = 0x00040000L,
WS_TILED = 0x00000000L,
WS_TILEDWINDOW = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX),
WS_VISIBLE = 0x10000000L,
WS_VSCROLL = 0x00200000L,
}
WindowStyles.WS_BORDER
WS_BORDER = 0x00800000L
WindowStyles.WS_CAPTION
WS_CAPTION = 0x00C00000L
WindowStyles.WS_CHILD
WS_CHILD = 0x40000000L
WindowStyles.WS_CHILDWINDOW
WS_CHILDWINDOW = 0x40000000L
WindowStyles.WS_CLIPCHILDREN
WS_CLIPCHILDREN = 0x02000000L
WindowStyles.WS_CLIPSIBLINGS
WS_CLIPSIBLINGS = 0x04000000L
WindowStyles.WS_DISABLED
WS_DISABLED = 0x08000000L
WindowStyles.WS_DLGFRAME
WS_DLGFRAME = 0x00400000L
WindowStyles.WS_GROUP
WS_GROUP = 0x00020000L
WindowStyles.WS_HSCROLL
WS_HSCROLL = 0x00100000L
WindowStyles.WS_ICONIC
WS_ICONIC = 0x20000000L
WindowStyles.WS_MAXIMIZE
WS_MAXIMIZE = 0x01000000L
WindowStyles.WS_MAXIMIZEBOX
WS_MAXIMIZEBOX = 0x00010000L
WindowStyles.WS_MINIMIZE
WS_MINIMIZE = 0x20000000L
WindowStyles.WS_MINIMIZEBOX
WS_MINIMIZEBOX = 0x00020000L
WindowStyles.WS_OVERLAPPED
WS_OVERLAPPED = 0x00000000L
WindowStyles.WS_OVERLAPPEDWINDOW
WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
WindowStyles.WS_POPUP
WS_POPUP = 0x80000000L
WindowStyles.WS_POPUPWINDOW
WS_POPUPWINDOW = (WS_POPUP | WS_BORDER | WS_SYSMENU)
WindowStyles.WS_SIZEBOX
WS_SIZEBOX = 0x00040000L
WindowStyles.WS_SYSMENU
WS_SYSMENU = 0x00080000L
WindowStyles.WS_TABSTOP
WS_TABSTOP = 0x00010000L
WindowStyles.WS_THICKFRAME
WS_THICKFRAME = 0x00040000L
WindowStyles.WS_TILED
WS_TILED = 0x00000000L
WindowStyles.WS_TILEDWINDOW
WS_TILEDWINDOW = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
WindowStyles.WS_VISIBLE
WS_VISIBLE = 0x10000000L
WindowStyles.WS_VSCROLL
WS_VSCROLL = 0x00200000L