In addition to existing tests this shows that the call SendMessage(listbox, LB_SETCOUNT, 100, 0); adds a scrollbar to the listbox however it doesn't add a nonclient area to an update region because the call ValidateRect(listbox, NULL); validates a client area, and after that a window no longer has an update region.
From: Dmitry Timoshkov dmitry@baikal.ru
In addition to existing tests this shows that the call SendMessage(listbox, LB_SETCOUNT, 100, 0); adds a scrollbar to the listbox however it doesn't add a nonclient area to an update region because the call ValidateRect(listbox, NULL); validates a client area, and after that a window no longer has an update region.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/user32/tests/listbox.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index c78171ff4d8..747e3dae192 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1939,11 +1939,17 @@ static void test_set_count( void ) GetUpdateRect( listbox, &r, TRUE ); ok( IsRectEmpty( &r ), "got non-empty rect\n");
+ ret = GetWindowLongA( listbox, GWL_STYLE ); + ok((ret & (WS_VSCROLL | WS_HSCROLL)) == 0, "Listbox should not have scroll bars\n"); + ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); ok( ret == 0, "got %ld\n", ret ); ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 ); ok( ret == 100, "got %ld\n", ret );
+ ret = GetWindowLongA( listbox, GWL_STYLE ); + ok((ret & (WS_VSCROLL | WS_HSCROLL)) == WS_VSCROLL, "Listbox should have vertical scroll bar\n"); + GetUpdateRect( listbox, &r, TRUE ); ok( !IsRectEmpty( &r ), "got empty rect\n");