Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat: added various windows api enums, constants and methods to WindowsApiService

Larsafd569aabd2a
diff --git a/LarsWM/WindowsApi/WindowsApiService.cs b/LarsWM/WindowsApi/WindowsApiService.cs
index 8abbd992..b20c6051 100644
--- a/LarsWM/WindowsApi/WindowsApiService.cs
+++ b/LarsWM/WindowsApi/WindowsApiService.cs
@@ -24,6 +24,88 @@ namespace LarsWM.WindowsApi
SWP_ASYNCWINDOWPOS = 0x4000
}
+ /// <summary>
+ /// Window styles
+ /// </summary>
+ [Flags]
+ public enum WS : uint
+ {
+ WS_OVERLAPPED = 0,
+ WS_POPUP = 0x80000000,
+ WS_CHILD = 0x40000000,
+ WS_MINIMIZE = 0x20000000,
+ WS_VISIBLE = 0x10000000,
+ WS_DISABLED = 0x8000000,
+ WS_CLIPSIBLINGS = 0x4000000,
+ WS_CLIPCHILDREN = 0x2000000,
+ WS_MAXIMIZE = 0x1000000,
+ WS_CAPTION = WS_BORDER | WS_DLGFRAME,
+ WS_BORDER = 0x800000,
+ WS_DLGFRAME = 0x400000,
+ WS_VSCROLL = 0x200000,
+ WS_HSCROLL = 0x100000,
+ WS_SYSMENU = 0x80000,
+ WS_THICKFRAME = 0x40000,
+ WS_MINIMIZEBOX = 0x20000,
+ WS_MAXIMIZEBOX = 0x10000,
+ WS_TILED = WS_OVERLAPPED,
+ WS_ICONIC = WS_MINIMIZE,
+ WS_SIZEBOX = WS_THICKFRAME,
+ WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
+ }
+
+ /// <summary>
+ /// Extended window styles
+ /// </summary>
+ [Flags]
+ public enum WS_EX : uint
+ {
+ WS_EX_DLGMODALFRAME = 0x0001,
+ WS_EX_NOPARENTNOTIFY = 0x0004,
+ WS_EX_TOPMOST = 0x0008,
+ WS_EX_ACCEPTFILES = 0x0010,
+ WS_EX_TRANSPARENT = 0x0020,
+ WS_EX_MDICHILD = 0x0040,
+ WS_EX_TOOLWINDOW = 0x0080,
+ WS_EX_WINDOWEDGE = 0x0100,
+ WS_EX_CLIENTEDGE = 0x0200,
+ WS_EX_CONTEXTHELP = 0x0400,
+ WS_EX_RIGHT = 0x1000,
+ WS_EX_LEFT = 0x0000,
+ WS_EX_RTLREADING = 0x2000,
+ WS_EX_LTRREADING = 0x0000,
+ WS_EX_LEFTSCROLLBAR = 0x4000,
+ WS_EX_RIGHTSCROLLBAR = 0x0000,
+ WS_EX_CONTROLPARENT = 0x10000,
+ WS_EX_STATICEDGE = 0x20000,
+ WS_EX_APPWINDOW = 0x40000,
+ WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE),
+ WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST),
+ WS_EX_LAYERED = 0x00080000,
+ WS_EX_NOINHERITLAYOUT = 0x00100000,
+ WS_EX_LAYOUTRTL = 0x00400000,
+ WS_EX_COMPOSITED = 0x02000000,
+ WS_EX_NOACTIVATE = 0x08000000
+ }
+
+ public static int GWL_STYLE = -16;
+ public static int GWL_EXSTYLE = -20;
+
+ public delegate bool EnumWindowsDelegate(IntPtr hWnd, int lParam);
+
+ [DllImport("user32.dll", EntryPoint = "EnumWindows", ExactSpelling = false, CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern bool EnumWindows(EnumWindowsDelegate enumCallback, IntPtr lParam);
+
+ [DllImport("user32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool IsWindowVisible(IntPtr hWnd);
+
+ [DllImport("user32.dll", EntryPoint = "GetWindowLongPtr")]
+ public static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);
+
+ [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
+ public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);
+
[DllImport("user32.dll")]
public static extern IntPtr BeginDeferWindowPos(int nNumWindows);