Skip to content

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

feat: started methods for getting style & extended style of a Window

Lars19a2762c9fc0
diff --git a/LarsWM/Window.cs b/LarsWM/Window.cs
index b6b7d00d..0000a283 100644
--- a/LarsWM/Window.cs
+++ b/LarsWM/Window.cs
@@ -6,5 +6,43 @@ namespace LarsWM
{
public class Window
{
+ public IntPtr Hwnd { get; set; }
+
+ public Window(IntPtr hwnd)
+ {
+ Hwnd = hwnd;
+ }
+
+ /// <summary>
+ /// This window's style flags.
+ /// </summary>
+ public WindowStyleFlags Style
+ {
+ get
+ {
+ return unchecked((WindowStyleFlags)GetWindowLongPtr(_hwnd, (int)(GWL.GWL_STYLE)).ToInt64());
+ }
+ set
+ {
+ SetWindowLong(_hwnd, (int)GWL.GWL_STYLE, (int)value);
+ }
+
+ }
+
+ /// <summary>
+ /// This window's extended style flags.
+ /// </summary>
+ [CLSCompliant(false)]
+ public WindowExStyleFlags ExtendedStyle
+ {
+ get
+ {
+ return unchecked((WindowExStyleFlags)GetWindowLongPtr(_hwnd, (int)(GWL.GWL_EXSTYLE)).ToInt64());
+ }
+ set
+ {
+ SetWindowLong(_hwnd, (int)GWL.GWL_EXSTYLE, (int)value);
+ }
+ }
}
}