From a1339cfdf91a191979bc51c39d18bf839f33f99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Mon, 1 Nov 2021 17:18:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=88=B0=E6=89=98=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.UI/MainWindow.xaml.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/FastGithub.UI/MainWindow.xaml.cs b/FastGithub.UI/MainWindow.xaml.cs index 1455341..ffade81 100644 --- a/FastGithub.UI/MainWindow.xaml.cs +++ b/FastGithub.UI/MainWindow.xaml.cs @@ -85,11 +85,15 @@ namespace FastGithub.UI { const int WM_SYSCOMMAND = 0x112; const int SC_MINIMIZE = 0xf020; + const int SC_CLOSE = 0xf060; - if (msg == WM_SYSCOMMAND && wParam.ToInt32() == SC_MINIMIZE) + if (msg == WM_SYSCOMMAND) { - this.Hide(); - handled = true; + if (wParam.ToInt32() == SC_MINIMIZE || wParam.ToInt32() == SC_CLOSE) + { + this.Hide(); + handled = true; + } } return IntPtr.Zero; }