Skip to content

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

feat(infra): add `SendMessage` method from Windows API

Lars Berger107420e52377
diff --git a/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs b/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs
index bf55d419..cd7e407f 100644
--- a/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs
+++ b/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs
@@ -227,5 +227,17 @@ namespace LarsWM.Infrastructure.WindowsApi
[DllImport("user32.dll")]
public static extern IntPtr SetWinEventHook(EventConstant eventMin, EventConstant eventMax, IntPtr hmodWinEventProc, WindowEventProc lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);
+
+ /// <summary>
+ /// Message types that can be passed to `SendMessage`. Only the subset of types relevant to
+ /// this application are included.
+ /// </summary>
+ public enum SendMessageType : uint
+ {
+ WM_CLOSE = 0x0010,
+ }
+
+ [DllImport("user32.dll", CharSet = CharSet.Auto)]
+ public static extern IntPtr SendMessage(IntPtr hWnd, SendMessageType Msg, IntPtr wParam, IntPtr lParam);
}
}