comctl32/tests: Fix Monthcal tests failures on some VMs.

This commit is contained in:
Nikolay Sivov 2015-03-01 21:08:13 +03:00 committed by Alexandre Julliard
parent 9419e97c3e
commit f935a10add
1 changed files with 9 additions and 0 deletions

View File

@ -612,7 +612,9 @@ static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wPa
static HWND create_monthcal_control(DWORD style)
{
WNDPROC oldproc;
RECT rect;
HWND hwnd;
BOOL ret;
hwnd = CreateWindowExA(0, MONTHCAL_CLASSA, "", WS_CHILD | WS_BORDER | WS_VISIBLE | style,
0, 0, 300, 400, parent_wnd, NULL, GetModuleHandleA(NULL), NULL);
@ -625,6 +627,13 @@ static HWND create_monthcal_control(DWORD style)
SendMessageA(hwnd, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0);
/* make sure calendar grid is 2x1 */
ret = SendMessageA(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&rect);
ok(ret, "got %d\n", ret);
ret = SetWindowPos(hwnd, NULL, 0, 0, rect.right * 5 / 2, rect.bottom * 3 / 2, SWP_NOMOVE);
ok(ret, "got %d\n", ret);
return hwnd;
}