当前位置: 动力学知识库 > 问答 > 编程问答 >

winapi - How to get the top frame height of a dwm extended and maximized window?

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: