On 15.02.2015 19:06, Changhui Liu wrote:
Hi Dmitry, Thank you for your advice.
I wouldn't be surprised if the control just does SendMessage with an appropriate message to itself. Is it possible to add a message test? I found that the messages sent to DateTimePick32 control is different in different windows and wine, for example,
so I think it is not suitable write a message test.
You only care about DTM_* messages. Do those differ too?
+DWORD WINAPI CheckMonthCalThread (void* param) +{ + int i = 0; + HWND hWndMonthCal = NULL; + + for (i=0; i<5; ++i) + { + Sleep(500); /*wait the SysMonthCal32 control to show*/ + + hWndMonthCal = FindWindowA("SysMonthCal32", NULL); + if (NULL != hWndMonthCal) + { + trace("monthcal=%p\n", hWndMonthCal); + ok(IsWindowVisible(hWndMonthCal), "Expected MonthCal to be visible\n"); + + /*select a day by click point(0x10, 0x10)*/ + PostMessageA(hWndMonthCal, WM_LBUTTONDOWN, 1, MAKEWPARAM(0x10,0x10)); + + *(HWND*)param = hWndMonthCal; + + return TRUE; + } + } + + ok(0, "Expected MonthCal to be valid\n"); + + return 0; +}
This looks a bit too much. First this needs a regular message test, including testing notifications being sent.
+ case WM_SYSKEYDOWN: + if (wParam == VK_DOWN) + { + POINT pt; + RECT rect; + GetClientRect(hwnd, &rect); + pt.x = rect.right - GetSystemMetrics(SM_CXVSCROLL)/2; + pt.y = rect.top + GetSystemMetrics(SM_CYHSCROLL)/2; + + return DATETIME_LButtonDown (infoPtr, (SHORT)pt.x, (SHORT)pt.y); + } + /*else continue to DefWindowProcW*/ +
As I said already, this is too complicated.