comctl32/datetime: Block WM_SETTEXT message.
This commit is contained in:
parent
f0c99e0115
commit
b398d4434d
|
@ -1399,6 +1399,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_GETFONT:
|
||||
return (LRESULT) infoPtr->hFont;
|
||||
|
||||
case WM_SETTEXT:
|
||||
return CB_ERR;
|
||||
|
||||
default:
|
||||
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
|
||||
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
|
||||
|
|
|
@ -668,6 +668,25 @@ static void test_dtm_set_and_get_system_time(void)
|
|||
DestroyWindow(hWnd);
|
||||
}
|
||||
|
||||
static void test_wm_set_get_text(void)
|
||||
{
|
||||
static const CHAR a_str[] = "a";
|
||||
char buff[10];
|
||||
HWND hWnd;
|
||||
LRESULT ret;
|
||||
|
||||
hWnd = create_datetime_control(0);
|
||||
|
||||
ret = SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)a_str);
|
||||
expect(CB_ERR, ret);
|
||||
|
||||
buff[0] = 0;
|
||||
ret = SendMessage(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff);
|
||||
ok(strcmp(buff, a_str) != 0, "Expected text not to change, got %s\n", buff);
|
||||
|
||||
DestroyWindow(hWnd);
|
||||
}
|
||||
|
||||
START_TEST(datetime)
|
||||
{
|
||||
HMODULE hComctl32;
|
||||
|
@ -694,4 +713,5 @@ START_TEST(datetime)
|
|||
test_dtm_set_and_get_range();
|
||||
test_dtm_set_range_swap_min_max();
|
||||
test_dtm_set_and_get_system_time();
|
||||
test_wm_set_get_text();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue