How do you get the border width (non-client) of an Edit theme control in Windows XP and later?
In Windows 7, GetThemeMetric
with TMT_BORDERSIZE
as identifier properties returns 0 for the existing edit control, and 1 if no handle. But upon closer inspection, it seems like it should be 2.
If the window styles are enabled for the control WS_VSCROLL
or WS_HSCROLL
, then the scroll bars are drawn inside this border, and they really are 2 pixels from the outer edge of the control, so I assume there is a way to get the right information.
The reason for the request is that I can set the size of the client area when it WM_NCCALCSIZE
occurs when creating a custom control.

source
share