I have a tough bug in which I get a misplaced WM_SIZE message that causes my window to resize to a wrong size.
Scenario 1 (good):
- The user performs an oparation that enlarges the window (among other non-windowing operations).
- The application calls SetWindowPlacement with the larger size.
- The window resizes correctly.
Scenario 2 (bug):
- Same as 1 and 2 above.
- In the few seconds before the window resizes, the user drags the window by its caption (it is possible to do so, since the operation takes a few seconds to complete).
- The window resizes to the larger size, and then immediately shrinks to the original size.
Using Spy++, I see that there is indeed a WM_SIZE sent with the larger size, but at the end also an extra WM_SIZE with the previous size.
I tried following other relevant messages: WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED, WM_MOUSEMOVE, WM_ENTERSIZEMOVE – none hinted on what was happening.
Any idea where I should look for the origin of this stray message?