From c53f5aa17c606778d5fa210cde6365474bd3275c Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Tue, 1 Apr 2025 19:01:15 -0500 Subject: [PATCH] Fix closing task not correctly coming to foreground --- src/ManagedShell.WindowsTasks/ApplicationWindow.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ManagedShell.WindowsTasks/ApplicationWindow.cs b/src/ManagedShell.WindowsTasks/ApplicationWindow.cs index 192f022b..8eb97fa9 100644 --- a/src/ManagedShell.WindowsTasks/ApplicationWindow.cs +++ b/src/ManagedShell.WindowsTasks/ApplicationWindow.cs @@ -700,6 +700,7 @@ private void makeForeground() internal IntPtr DoClose() { + makeForeground(); IntPtr retval = IntPtr.Zero; NativeMethods.SendMessageTimeout(Handle, (int)NativeMethods.WM.SYSCOMMAND, NativeMethods.SC_CLOSE, 0, 2, 200, ref retval);