Code: Select all
// MSDN: "The AdjustWindowRectEx function does not take the WS_VSCROLL or WS_HSCROLL styles into
// account. To account for the scroll bars, call the GetSystemMetrics function with SM_CXVSCROLL
// or SM_CYHSCROLL."
if (style & WS_HSCROLL)
width += GetSystemMetrics(SM_CXHSCROLL);
if (style & WS_VSCROLL)
height += GetSystemMetrics(SM_CYVSCROLL);
Also, there's a discrepancy between the comment and the code.