From: "Changhui Liu" Subject: comctl32: SysDateTimePick32 control add Alt+down hot key like windows Message-Id: Date: Fri, 13 Feb 2015 16:26:40 +0800 ------------------ Regards, Changhui.






------------------
Regards,
Changhui.
 
From b389e6362878aff3943c3d78154a21a40520970d Mon Sep 17 00:00:00 2001 From: Changhui Liu Date: Fri, 13 Feb 2015 16:21:40 +0800 Subject: comctl32: SysDateTimePick32 control add Alt+down hot key like windows To: wine-patches Reply-To: wine-devel --- dlls/comctl32/datetime.c | 12 ++++++++++++ dlls/comctl32/tests/datetime.c | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index 5c73a90..66d34a7 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -1668,6 +1668,18 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SETTEXT: return CB_ERR; + 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); + } + default: if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg)) ERR("unknown msg %04x wp=%08lx lp=%08lx\n", diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index 195c719..c90c5ae 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -782,6 +782,25 @@ static void test_dts_shownone(void) DestroyWindow(hwnd); } +static void test_dtm_hotkey(void) +{ + HWND hWnd; + HWND hWndMonthCal; + + hWnd = create_datetime_control(0); + ok(hWnd != NULL, "Expected window to be valid\n"); + ShowWindow(hWnd, SW_NORMAL); + + hWndMonthCal = SendMessageA(hWnd, DTM_GETMONTHCAL, 0, 0); + ok(hWndMonthCal != NULL, "Expected MonthCal to be valid\n"); + ok(!IsWindowVisible(hWndMonthCal), "Expected MonthCal to be invisible\n"); + + SendMessageA(hWnd, WM_SYSKEYDOWN, VK_DOWN, 0); + ok(IsWindowVisible(hWndMonthCal), "Expected MonthCal to be visible\n"); + + DestroyWindow(hWnd); +} + START_TEST(datetime) { HMODULE hComctl32; @@ -811,4 +830,5 @@ START_TEST(datetime) test_dtm_set_and_get_systemtime_with_limits(); test_wm_set_get_text(); test_dts_shownone(); + test_dtm_hotkey(); } -- 1.9.1