I created a window using dwmextendframeintoclientarea, everything is ok except the top frame height is less than the value I settled while the window is maximized.
So the text drawn using drawthemetext will not align absolutly vertical center as following picture shows.
the first one is the caption bar while the window is normal size, while the second window is maximized.
It is because the height of the top frame actually is less than the value I setted in DwmExtendFrameIntoClientArea.
The problem is how could I get the real height of the top frame while dwm is enable and the window is maximized?
When your application is maximized, Windows actually sizes it slightly larger than the screen. The edges of your window thus extend offscreen, resulting in the rendering you observed. You can use the position and size received in the
MINMAXINFO struct in the
WM_GETMINMAXINFO message sent to your window to determine just how far offscreen your window extends, and use that to adjust your rendering when maximized.