Re: comctl32: SysDateTimePick32 control add Alt+down hot key like windows
"Changhui Liu" <liuchanghui(a)linuxdeepin.com> wrote:
+ 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);
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?
+ } +
Did you miss a 'break;' or a fall through is intentiional? In the latter case please add a proper comment. -- Dmitry.
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, 1, In wine, the messages are:
trace:datetime:DATETIME_WindowProc 104, 28, 0 trace:datetime:DATETIME_WindowProc 86, 0, 1e005a trace:datetime:DATETIME_WindowProc 6, 0, 1e005a trace:datetime:DATETIME_WindowProc 8, 1e005a, 0 2, In winxp pro 32bit: datetime.c:839: 0: expected: nothing - actual: 0104 wp 00000028 lp 00000000 datetime.c:839: 1: expected: nothing - actual: 0055 wp 00030196 lp 00000003 datetime.c:839: 2: expected: nothing - actual: 0129 wp 00000000 lp 00000000 datetime.c:839: 3: expected: nothing - actual: 0031 wp 00000000 lp 00000000 datetime.c:839: 4: expected: nothing - actual: 0014 wp 01010050 lp 00000000 datetime.c:839: 5: expected: nothing - actual: 007f wp 00000002 lp 00000000 datetime.c:839: 6: expected: nothing - actual: 007f wp 00000000 lp 00000000 datetime.c:839: 7: expected: nothing - actual: 007f wp 00000001 lp 00000000 datetime.c:839: 8: expected: nothing - actual: 000f wp 00000000 lp 00000000 datetime.c:839: 9: expected: nothing - actual: 0085 wp 5d040652 lp 00000000 datetime.c:839: 10: expected: nothing - actual: 000d wp 00000208 lp 0022e884 datetime.c:839: 11: expected: nothing - actual: 000d wp 00000208 lp 0022e920 datetime.c:839: 12: expected: nothing - actual: 0014 wp 01010053 lp 00000000 3, In win8 32bit: datetime.c:839: 0: expected: nothing - actual: 0104 wp 00000028 lp 00000000 datetime.c:839: 1: expected: nothing - actual: 0055 wp 000300f6 lp 00000003 datetime.c:839: 2: expected: nothing - actual: 0129 wp 00000000 lp 00000000 datetime.c:839: 3: expected: nothing - actual: 0031 wp 00000000 lp 00000000 datetime.c:839: 4: expected: nothing - actual: 0014 wp 140105d7 lp 00000000 datetime.c:839: 5: expected: nothing - actual: 007f wp 00000001 lp 00000000 datetime.c:839: 6: expected: nothing - actual: 007f wp 00000002 lp 00000000 datetime.c:839: 7: expected: nothing - actual: 007f wp 00000000 lp 00000000 datetime.c:839: 8: expected: nothing - actual: 031f wp 00000001 lp 00000000 datetime.c:839: 9: expected: nothing - actual: 031f wp 00000001 lp 00000000 datetime.c:839: 10: expected: nothing - actual: 000f wp 00000000 lp 00000000 so I think it is not suitable write a message test.
Did you miss a 'break;' or a fall through is intentiional? In the latter case please add a proper comment.
It is the latter case, I attached a new path, please help me review it again when you are free. Thanks a lot. ------------------ Regards, Changhui. ------------------ Original ------------------ From: "Dmitry Timoshkov"<dmitry(a)baikal.ru>; Date: Fri, Feb 13, 2015 07:07 PM To: "Changhui Liu"<liuchanghui(a)linuxdeepin.com>; Cc: "wine-devel"<wine-devel(a)winehq.org>; Subject: Re: comctl32: SysDateTimePick32 control add Alt+down hot key likewindows "Changhui Liu" <liuchanghui(a)linuxdeepin.com> wrote:
+ 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);
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?
+ } +
Did you miss a 'break;' or a fall through is intentiional? In the latter case please add a proper comment. -- Dmitry.
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.
participants (3)
-
Changhui Liu -
Dmitry Timoshkov -
Nikolay Sivov