Share via

Windows 11 – Different behavior of SW_SHOWMAXIMIZED in multi-monitor MFC application

Siji, Merlin 0 Reputation points
2026-02-25T08:55:23.7466667+00:00

We have an MFC MDI application running in a multi-monitor setup.

On Windows 10, minimizing the application and restoring it via taskbar click correctly maximizes it across all monitors.

Starting with Windows 11 23H2, after minimizing the application, clicking the taskbar icon does not restore/maximize it across all monitors.

In OnSysCommand, we handle SC_RESTORE as follows:

if (nID == SC_RESTORE)

If SW_SHOWMAXIMIZED is replaced with SW_RESTORE, the behavior works correctly on Windows 11. However, our application relies on SW_SHOWMAXIMIZED in multiple other places, so making this change is not straightforward.

Has there been a change in window management behavior in Windows 11 23H2 that affects SW_SHOWMAXIMIZED during SC_RESTORE?

Is there a recommended approach for maximizing windows across multiple monitors in Windows 11?

Windows development | Windows API - Win32
{count} votes

2 answers

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 15,205 Reputation points Microsoft External Staff Moderator
    2026-02-26T06:46:44.9533333+00:00

    Hi @Siji, Merlin ,

    Thanks for reaching out.

    I looked at the behavior you’re seeing with SW_SHOWMAXIMIZED on Windows 11 23H2 in a multi-monitor MFC setup. Specifically:

    • When you call ShowWindow(SW_SHOWMAXIMIZED) and then immediately MoveWindow, Windows may not always apply the maximized state to all monitors consistently. In Windows 10, this sequence often “just worked,” but Windows 11 is stricter about letting the system handle maximized window positioning.
    • Your current if (nID == SC_RESTORE) check is also a bit fragile, it’s better to mask the lower bits like (nID & 0xFFF0) == SC_RESTORE to reliably catch restore messages.

    I suggest a couple of approaches:

    1. Let the system handle maximization: Call ShowWindow(SW_SHOWMAXIMIZED) for each window and avoid calling MoveWindow afterward. Windows will place the window on the correct monitor.
    2. Reposition before maximizing: If you need precise positioning, call MoveWindow first to set the bounds, then call ShowWindow(SW_SHOWMAXIMIZED), which should ensure the window is maximized with the intended geometry.

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.


  2. Q&A Assist
    2026-02-25T08:55:33.9033333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    There has been a change in window management behavior in Windows 11, particularly in version 23H2, which may affect how SW_SHOWMAXIMIZED operates in multi-monitor setups. While the specific details of this change are not explicitly documented in the provided context, it is noted that applications may experience different behaviors when restoring from minimized states.

    In your case, since replacing SW_SHOWMAXIMIZED with SW_RESTORE resolves the issue, it suggests that the new behavior in Windows 11 23H2 may not handle maximization across multiple monitors as it did in Windows 10. This could be due to changes in how Windows 11 manages window states and monitor configurations.

    As a recommended approach, you might consider implementing a conditional check in your OnSysCommand method to determine the current operating system version. If it detects Windows 11 23H2 or later, you could use SW_RESTORE for restoring the window, while continuing to use SW_SHOWMAXIMIZED in other parts of your application where it is necessary. This hybrid approach would maintain compatibility with both Windows 10 and Windows 11 behaviors without requiring extensive changes to your existing codebase.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.