Question

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 normal size

maximized window

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top