diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index 2054bc2c0..e87004251 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -34,14 +34,6 @@ WINDOW_STYLE SetLastError WINDOW_EX_STYLE -GetSystemMetrics -EnumDisplayMonitors -MonitorFromWindow -GetMonitorInfo -MONITORINFOEXW -GetCursorPos -MonitorFromPoint - WM_ENTERSIZEMOVE WM_EXITSIZEMOVE WM_NCLBUTTONDBLCLK diff --git a/Flow.Launcher.Plugin/NativeMethods.txt b/Flow.Launcher.Plugin/NativeMethods.txt index 0596691cc..901695a8b 100644 --- a/Flow.Launcher.Plugin/NativeMethods.txt +++ b/Flow.Launcher.Plugin/NativeMethods.txt @@ -5,4 +5,12 @@ GetWindowTextLength WM_KEYDOWN WM_KEYUP WM_SYSKEYDOWN -WM_SYSKEYUP \ No newline at end of file +WM_SYSKEYUP + +GetSystemMetrics +EnumDisplayMonitors +MonitorFromWindow +GetMonitorInfo +MONITORINFOEXW +GetCursorPos +MonitorFromPoint \ No newline at end of file diff --git a/Flow.Launcher.Infrastructure/CursorInfo.cs b/Flow.Launcher.Plugin/SharedModels/CursorInfo.cs similarity index 79% rename from Flow.Launcher.Infrastructure/CursorInfo.cs rename to Flow.Launcher.Plugin/SharedModels/CursorInfo.cs index 046dc4ba9..720bf2ae3 100644 --- a/Flow.Launcher.Infrastructure/CursorInfo.cs +++ b/Flow.Launcher.Plugin/SharedModels/CursorInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; using Windows.Win32; -namespace Flow.Launcher.Infrastructure; +namespace Flow.Launcher.Plugin.SharedModels; /// /// Contains full information about a cursor. @@ -12,6 +12,9 @@ namespace Flow.Launcher.Infrastructure; /// public class CursorInfo { + /// + /// Gets the current position of the cursor in screen coordinates. + /// public static Point Position { get diff --git a/Flow.Launcher.Infrastructure/MonitorInfo.cs b/Flow.Launcher.Plugin/SharedModels/MonitorInfo.cs similarity index 97% rename from Flow.Launcher.Infrastructure/MonitorInfo.cs rename to Flow.Launcher.Plugin/SharedModels/MonitorInfo.cs index a87aab7d8..22e09e2f5 100644 --- a/Flow.Launcher.Infrastructure/MonitorInfo.cs +++ b/Flow.Launcher.Plugin/SharedModels/MonitorInfo.cs @@ -7,7 +7,7 @@ using Windows.Win32.Foundation; using Windows.Win32.Graphics.Gdi; using Windows.Win32.UI.WindowsAndMessaging; -namespace Flow.Launcher.Infrastructure; +namespace Flow.Launcher.Plugin.SharedModels; /// /// Contains full information about a display monitor. @@ -75,7 +75,7 @@ public class MonitorInfo /// The primary display monitor, or null if no monitor is found. public static unsafe MonitorInfo GetPrimaryDisplayMonitor() { - var primaryMonitor = PInvoke.MonitorFromWindow(new HWND(IntPtr.Zero), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY); + var primaryMonitor = PInvoke.MonitorFromWindow(new HWND(nint.Zero), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY); MonitorInfo primaryMonitorInfo = null; var callback = new MONITORENUMPROC((monitor, deviceContext, rect, data) => { @@ -163,7 +163,7 @@ public class MonitorInfo /// /// Gets if the monitor is the primary display monitor. /// - public bool IsPrimary => _monitor == PInvoke.MonitorFromWindow(new(IntPtr.Zero), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY); + public bool IsPrimary => _monitor == PInvoke.MonitorFromWindow(new(nint.Zero), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY); /// public override string ToString() => $"{Name} {Bounds.Width}x{Bounds.Height}";