How to get the height and width of the title bar for aero and basic design

I use GetSystemMetrics(SM_CXSIZEFRAME)for the width of the frame, it works with the basic design, but not with aero, how can I improve it, so does it work with aero?

I use the GetSystemMetrics(SM_CYCAPTION)title bar for the height, but the value is too small for the base and aero design, what am I doing wrong here?

+3
source share
2 answers

In non-poor Windows GetSystemMetrics(SM_CYCAPTION), the height of the text in the title bar; you need to add border and border size ( GetSystemMetrics(SM_CYSIZEFRAME) + GetSystemMetrics(SM_CYEDGE) * 2).

For Windows-themed ones (this is the default by now) GetThemeSysSize, most likely the function you are looking for; in particular, GetThemeSysSize(SM_CXBORDER)for the width of the frame and GetThemeSysSize(SM_CYSIZE) + GetThemeSysSize(SM_CXPADDEDBORDER) * 2for the title.

+2

, Y, .

, GetSystemMetrics, GetWindowRect ClientToScreen.

, ClientToScreen 0,0. , GetWindowRect. - . .

0

All Articles