I dealt with this recently, and the approach I settled on was to check IsZoomed
in response to WM_WINDOWPOSCHANGED
, comparing its result to the previous one to detect when a transition occurs, and then to forward WM_WINDOWPOSCHANGED
to the default window procedure.
If you have complete control over the message handling in your application and know that there isn't (and won't ever be) a WM_WINDOWPOSCHANGED
handler that suppresses WM_MOVE
/WM_SIZE
, then you should be able to handle it directly in a WM_SIZE
handler as described in jachguate's answer.
GetWindowPlacement
/SetWindowPlacement
rather than, say,GetWindowRect
/SetWindowPos
. To remove maximize button, omit theWS_MAXIMIZEBOX
flag inCreateWindow
. To limit window size, handleWM_SIZING
. And so on.) With apologies for trying to second-guess a simple question, as I hate it when people do that. – Tom SeddonCS_VREDEAW | CS_HREDRAW
styles. – Raymond Chen