From 532b5dc4c90b03399136299cc514aecd65d59eb5 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 19 Dec 2024 14:08:46 +0800 Subject: [PATCH] Replace flags with CSWin32 --- Flow.Launcher/MainWindow.xaml.cs | 6 ++---- Flow.Launcher/NativeMethods.txt | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index b4f1fb031..8ca153afc 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -78,21 +78,19 @@ namespace Flow.Launcher InitializeComponent(); } - private const int WM_ENTERSIZEMOVE = 0x0231; - private const int WM_EXITSIZEMOVE = 0x0232; private int _initialWidth; private int _initialHeight; private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { - if (msg == WM_ENTERSIZEMOVE) + if (msg == PInvoke.WM_ENTERSIZEMOVE) { _initialWidth = (int)Width; _initialHeight = (int)Height; handled = true; } - if (msg == WM_EXITSIZEMOVE) + if (msg == PInvoke.WM_EXITSIZEMOVE) { if (_initialHeight != (int)Height) { diff --git a/Flow.Launcher/NativeMethods.txt b/Flow.Launcher/NativeMethods.txt index bbf55502e..2b147c05f 100644 --- a/Flow.Launcher/NativeMethods.txt +++ b/Flow.Launcher/NativeMethods.txt @@ -11,4 +11,7 @@ GetShellWindow GetWindowRect GetClassName FindWindowEx -WINDOW_STYLE \ No newline at end of file +WINDOW_STYLE + +WM_ENTERSIZEMOVE +WM_EXITSIZEMOVE \ No newline at end of file