I have a layered window set up in my MFC application. I have set up my own derivation of CDialog to allow me to customise various parts of how the window is rendered. Everything works fine right up until I start worrying about minimise and maximise.
If you click minimise or maximise then the window reacts exactly as you'd expect (ie exactly as it does when NOT using a layered window). However, when I restore the window something very odd happens.
The default client rectangle for my test window is 324x102. When I restore from the minimised state, for example, the cx and cy passed to OnSize is 994, 550. If I then do a GetClientRect (within OnSize) this is the size reported for the window. Weirdly, though if i do GetWindowRect I get the correct size back (though obviously including all my non-client areas).
Does anybody have any idea what is going on here and, more importantly, how I can fix it such that GetClientRect reports the CORRECT information?
Thanks in advance!