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);