From bd926c64f6ad7db36f91bbe4cf60e67f92a6e094 Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Sun, 1 Sep 2024 12:59:18 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=E4=BB=A4=E7=89=8C?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=BC=BA=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Utilities/PowerManagement.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MaaWpfGui/Utilities/PowerManagement.cs b/src/MaaWpfGui/Utilities/PowerManagement.cs index fa0fe60972..c8ef6b14c1 100644 --- a/src/MaaWpfGui/Utilities/PowerManagement.cs +++ b/src/MaaWpfGui/Utilities/PowerManagement.cs @@ -63,6 +63,7 @@ namespace MaaWpfGui.Utilities private const int TOKEN_QUERY = 0x0008; private const int EWX_SHUTDOWN = 0x00000001; private const int EWX_FORCE = 0x00000004; + private const int EWX_FORCEIFHUNG = 0x00000010; public static bool Shutdown() { @@ -94,7 +95,7 @@ namespace MaaWpfGui.Utilities throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); } - if (!ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE, 0)) + if (!ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCEIFHUNG, 0)) { throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); }