Commit fd53a4b8 authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

comctl32: Implement WM_GETTEXTLENGTH for datetime picker.

parent d851b2f8
......@@ -1565,6 +1565,20 @@ DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst)
return lstrlenW(dst);
}
static int DATETIME_GetTextLength(const DATETIME_INFO *info)
{
int i, length = 0;
WCHAR buffer[80];
TRACE("%p.\n", info);
for (i = 0; i < info->nrFields; i++)
{
DATETIME_ReturnTxt(info, i, buffer, ARRAY_SIZE(buffer));
length += lstrlenW(buffer);
}
return length;
}
static LRESULT WINAPI
DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
......@@ -1681,6 +1695,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_GETTEXT:
return (LRESULT) DATETIME_GetText(infoPtr, wParam, (LPWSTR)lParam);
case WM_GETTEXTLENGTH:
return (LRESULT)DATETIME_GetTextLength(infoPtr);
case WM_SETTEXT:
return CB_ERR;
......
......@@ -793,7 +793,12 @@ static void test_wm_set_get_text(void)
if (ret == 0)
skip("GetDateFormat failed, returned %ld, error %d\n", ret, GetLastError());
else
{
ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);
ret = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
ok(ret == strlen(time), "Got wrong length: %ld, expected %d.\n", ret, strlen(time));
}
}
DestroyWindow(hWnd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment