The WM_SIZE event with wParam == SIZE_RESTORED is sent to the window at:

  • Minimize to normal size after expanding to full screen.
  • Maximize the window after minimizing the taskbar.
  • Resize the window with the mouse over the edge of the window.

The bottom line is that I need to handle the first two situations and ignore the third. Is there any way to distinguish these events?

  • one
    Yes, just remember the previous state ... if it is not maximized / minimized, but normal, then this user drags the border with the mouse. - Akina
  • Oh, right. Thank! - UnicornumVerum
  • You can still delve into the WINDOWPLACEMENT structure ( WINDOWPLACEMENT call), compare its state before and after DefWindowProc call to this event, for sure there is something fixed (flags or window position). - mega

0