(from <Someone>)

W340-6 fix
fixed: mswin_menu_size incremented width of the actual menu window
each time being called. This only happens if "show window content
while dragging" option is set in Windows desktop settings.
This commit is contained in:
nethack.allison
2002-04-18 22:21:05 +00:00
parent d493eb8d90
commit 20472e645c

View File

@@ -1268,12 +1268,16 @@ void mswin_menu_window_size (HWND hWnd, LPSIZE sz)
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);
@@ -1331,7 +1335,7 @@ void mswin_menu_window_size (HWND hWnd, LPSIZE sz)
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);
}