1

We store and reload window positions using the GetWindowPlacement/SetWindowPlacement API routines. This up to now worked well.

Now sometimes this fails to properly reload a maximized window: The window doesn't cover the whole work area like it should. But the window "believes" it is maximized:

  • It shows a "Restore" button instead of "Maximize". screenshot of window title bar
  • Its WindowState is wsMaximized.
  • Calling GetWindowPlacement yields showCmd = SW_SHOWMAXIMIZED.

I tried a few workarounds like calling ShowWindow(SW_SHOWMAXIMIZED) directly or delayed with PostMessage and assigning WindowState but to no avail. Unfortunately I'm unable to extract a SSCCE for the issue. Maybe you have advice how to fix the issue from the mentioned symptoms without one?

Uli Gerhardt
  • 13,748
  • 1
  • 45
  • 83
  • 3
    Attempting to resize a maximized window, without restoring it, can cause this. See [this question](https://stackoverflow.com/questions/19480394/wsmaximized-forms-do-not-appear-maximized) for an example. – Sertac Akyuz Apr 04 '19 at 19:59

0 Answers0