// Generated API outline. Implementation bodies omitted.
#nullable enable
namespace Xui.Runtime.Windows.Win32
{
using System.Runtime.InteropServices;
using static Xui.Runtime.Windows.Win32.Types;
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;
/// COLORREF value that indicates "no color" / transparent for DWM attributes.
public const int DWMWA_COLOR_NONE = unchecked((int)0xFFFFFFFE);
/// Mica backdrop (Windows 11 22H2+).
public const int DWMSBT_MAINWINDOW = 2;
/// Acrylic backdrop (Windows 11 22H2+).
public const int DWMSBT_TRANSIENTWINDOW = 3;
/// Mica Alt / Tabbed backdrop (Windows 11 22H2+).
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 partial class User32
{
/// 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;
}
}
}
namespace Xui.Runtime.Windows.Win32
{
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);
}
public static unsafe partial class Kernel32
{
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetCurrentThreadId", ExactSpelling = true)]
public static extern partial uint GetCurrentThreadId();
}
public static partial class Types
{
public partial struct COLORREF
{
public uint __BBGGRR;
public COLORREF(uint 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);
}
}
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
{
public unsafe struct NCCALCSIZE_PARAMS
{
public RECT r1;
public RECT r2;
public RECT r3;
public WINDOWPOS* lppos;
}
}
public static partial class User32
{
public enum SystemCursor : int
{
/// Standard arrow cursor (IDC_ARROW)
Arrow = 32512,
/// I-beam text cursor (IDC_IBEAM)
IBeam = 32513,
/// Hourglass / wait (legacy) (IDC_WAIT)
Wait = 32514,
/// Crosshair (IDC_CROSS)
Cross = 32515,
/// Up arrow (rarely used) (IDC_UPARROW)
UpArrow = 32516,
/// Resize NW-SE / diagonal (IDC_SIZENWSE)
SizeNWSE = 32642,
/// Resize NE-SW / diagonal (IDC_SIZENESW)
SizeNESW = 32643,
/// Resize horizontal (IDC_SIZEWE)
SizeWE = 32644,
/// Resize vertical (IDC_SIZENS)
SizeNS = 32645,
/// Resize all directions (IDC_SIZEALL)
SizeAll = 32646,
/// Slashed circle (not allowed) (IDC_NO)
No = 32648,
/// Hand / link cursor (IDC_HAND)
Hand = 32649,
/// Application starting (arrow + wait) (IDC_APPSTARTING)
AppStarting = 32650,
/// Help cursor (arrow + question) (IDC_HELP)
Help = 32651,
}
}
public static partial class User32
{
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsyscolor#parameters
public enum WindowColor : int
{
COLOR_WINDOW = 5,
COLOR_3DFACE = 15
}
}
public static partial class User32
{
/// 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,
}
}
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);
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Runtime.InteropServices;
public static partial class Kernel32
{
public const string Kernel32Lib = "kernel32.dll";
/// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadid
[LibraryImport(Kernel32Lib)]
public static partial uint GetCurrentThreadId();
}
public static partial class User32
{
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;
}
}
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.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
{
///
/// 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;
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Diagnostics;
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
{
[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);
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Diagnostics;
using System.Runtime.CompilerServices;
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 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);
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Xui.Core.Math2D;
using static Xui.Runtime.Windows.Win32.User32;
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);
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Diagnostics;
using System.Runtime.CompilerServices;
using Xui.Core.Math2D;
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 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);
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System;
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
{
///
/// 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,
}
}
public static partial class User32
{
[Flags]
public enum LayeredWindowAttribute : long
{
LWA_COLORKEY = 0x00000001,
LWA_ALPHA = 0x00000002,
}
}
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
{
[Flags]
public enum TrackMouseEventFlags : uint
{
TME_HOVER = 0x00000001,
TME_LEAVE = 0x00000002,
TME_CANCEL = 0x80000000
}
}
public static partial class User32
{
///
/// 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,
}
}
public static partial class User32
{
///
/// 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,
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Runtime.InteropServices;
using System;
using static Xui.Runtime.Windows.Win32.Types;
public static partial class User32
{
/// 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;
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Runtime.InteropServices;
using Xui.Core.Math2D;
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);
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Runtime.InteropServices;
using System;
using static Xui.Runtime.Windows.Win32.Types;
using static Xui.Runtime.Windows.Win32.User32.Types;
public static partial class User32
{
///
/// 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;
}
}
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);
///
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerclassexw
///
[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);
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-translatemessage
[LibraryImport(User32Lib)]
public static partial int TranslateMessage(ref MSG msg);
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-dispatchmessagew
[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
[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
[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-postmessagew
[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);
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagew
[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);
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postthreadmessagew
[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-msgwaitformultipleobjectsex
[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);
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postquitmessage
[LibraryImport(User32Lib)]
public static partial void PostQuitMessage(int nExitCode);
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroywindow
[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);
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System;
using static Xui.Runtime.Windows.Win32.Types;
public static partial class User32
{
public static partial class Types
{
[DebuggerDisplay("{Value}")]
public partial struct HWND : IEquatable
{
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);
///
/// Gets the DPI scale for this window.
/// 1.0 = 100% DPI (96 DPI), 2.0 = 200% DPI (192 DPI).
///
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);
}
}
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Runtime.InteropServices;
using static Xui.Runtime.Windows.Win32.Types;
using static Xui.Runtime.Windows.Win32.User32.Types;
public static partial class User32
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate int WNDPROC(HWND hwnd, WindowMessage uMsg, WPARAM wParam, LPARAM lParam);
}
}
namespace Xui.Runtime.Windows.Win32
{
using System.Runtime.InteropServices;
using System;
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,
}
}
}