HDC hdc;
PNHMenuWindow data;
int i;
- RECT rt;
+ RECT rt, wrt;
+ int extra_cx;
GetClientRect(hWnd, &rt);
sz->cx = rt.right - rt.left;
sz->cy = rt.bottom - rt.top;
+ GetWindowRect(hWnd, &wrt);
+ extra_cx = (wrt.right-wrt.left) - sz->cx;
+
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
if(data) {
control = GetMenuControl(hWnd);
sz->cx = max(sz->cx, text_rt.right - text_rt.left + 5*tm.tmAveCharWidth + tm.tmOverhang);
SelectObject(hdc, saveFont);
}
- sz->cx += GetSystemMetrics(SM_CXVSCROLL) + 2*GetSystemMetrics(SM_CXSIZEFRAME);
+ sz->cx += extra_cx;
ReleaseDC(control, hdc);
}