diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 64691e46961..5a78ddaa814 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -27,8 +27,6 @@ * If you discover missing features, or bugs, please note them below. * * TODO: - * - GetListBoxInfo() - * - LB_GETLISTBOXINFO * - LBS_NODATA */ @@ -2955,8 +2953,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return LB_OKAY; case LB_GETLISTBOXINFO: - FIXME("LB_GETLISTBOXINFO: stub!\n"); - return 0; + return descr->page_size; case WM_DESTROY: return LISTBOX_Destroy( descr ); @@ -3149,3 +3146,9 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return unicode ? DefWindowProcW( hwnd, msg, wParam, lParam ) : DefWindowProcA( hwnd, msg, wParam, lParam ); } + +DWORD WINAPI GetListBoxInfo(HWND hwnd) +{ + TRACE("%p\n", hwnd); + return SendMessageW(hwnd, LB_GETLISTBOXINFO, 0, 0); +} diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 5d96f5ccd02..0a000ccd772 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1545,6 +1545,49 @@ static void test_set_count( void ) DestroyWindow( parent ); } +static DWORD (WINAPI *pGetListBoxInfo)(HWND); +static int lb_getlistboxinfo; + +static LRESULT WINAPI listbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA); + + if (message == LB_GETLISTBOXINFO) + lb_getlistboxinfo++; + + return CallWindowProcA(oldproc, hwnd, message, wParam, lParam); +} + +static void test_GetListBoxInfo(void) +{ + HWND listbox, parent; + WNDPROC oldproc; + DWORD ret; + + pGetListBoxInfo = (void*)GetProcAddress(GetModuleHandle("user32"), "GetListBoxInfo"); + + if (!pGetListBoxInfo) + { + win_skip("GetListBoxInfo() not available\n"); + return; + } + + parent = create_parent(); + listbox = create_listbox(WS_CHILD | WS_VISIBLE, parent); + + oldproc = (WNDPROC)SetWindowLongPtrA(listbox, GWLP_WNDPROC, (LONG_PTR)listbox_subclass_proc); + SetWindowLongPtrA(listbox, GWLP_USERDATA, (LONG_PTR)oldproc); + + lb_getlistboxinfo = 0; + ret = pGetListBoxInfo(listbox); + ok(ret > 0, "got %d\n", ret); +todo_wine + ok(lb_getlistboxinfo == 0, "got %d\n", lb_getlistboxinfo); + + DestroyWindow(listbox); + DestroyWindow(parent); +} + START_TEST(listbox) { const struct listbox_test SS = @@ -1624,4 +1667,5 @@ START_TEST(listbox) test_listbox_LB_DIR(); test_listbox_dlgdir(); test_set_count(); + test_GetListBoxInfo(); } diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 1ad59d9a838..4b1f4b5b040 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -308,7 +308,7 @@ @ stdcall GetLastActivePopup(long) @ stdcall GetLastInputInfo(ptr) @ stdcall GetLayeredWindowAttributes(long ptr ptr ptr) -# @ stub GetListBoxInfo +@ stdcall GetListBoxInfo(long) @ stdcall GetMenu(long) @ stdcall GetMenuBarInfo(long long long ptr) @ stdcall GetMenuCheckMarkDimensions()