From abb4ec032ba483fc858af52ca7a4205982565d89 Mon Sep 17 00:00:00 2001 From: Scighost Date: Sun, 3 Dec 2023 16:35:31 +0800 Subject: [PATCH] intercept SC_MAXIMIZE of WM_SYSCOMMAND to avoid fullscreen mode #499 --- src/Starward/MainWindow.xaml.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Starward/MainWindow.xaml.cs b/src/Starward/MainWindow.xaml.cs index 7fc7c4c40..b914ed901 100644 --- a/src/Starward/MainWindow.xaml.cs +++ b/src/Starward/MainWindow.xaml.cs @@ -300,6 +300,14 @@ public void ChangeAccentColor(Color? backColor = null, Color? foreColor = null) public IntPtr SUBCLASSPROC(HWND hWnd, uint uMsg, IntPtr wParam, IntPtr lParam, nuint uIdSubclass, IntPtr dwRefData) { + if (uMsg == ((uint)User32.WindowMessage.WM_SYSCOMMAND)) + { + // SC_MAXIMIZE + if (wParam == 0xF030) + { + return IntPtr.Zero; + } + } return ComCtl32.DefSubclassProc(hWnd, uMsg, wParam, lParam); }