Skip to content

Commit de74494

Browse files
committed
Handle system close command to open Shut Down Windows dialog box
Just like the stock taskbar does.
1 parent 6d11c07 commit de74494

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

RetroBar/Taskbar.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lP
226226
{
227227
windowManager.NotifyWorkAreaChange();
228228
}
229+
else if (msg == (int)NativeMethods.WM.SYSCOMMAND && wParam == (IntPtr)NativeMethods.SC_CLOSE)
230+
{
231+
IntPtr progmanHwnd = NativeMethods.FindWindow("Progman", "Program Manager");
232+
NativeMethods.SendMessage(progmanHwnd, (int)NativeMethods.WM.CLOSE, IntPtr.Zero, IntPtr.Zero);
233+
}
229234

230235
return IntPtr.Zero;
231236
}

0 commit comments

Comments
 (0)