-- v2: comctl32: Implement WM_GETOBJECT for buttons.
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/button.c | 5 +++++ dlls/comctl32/tests/button.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 9e7eaedc383..11a9760e3e2 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -885,6 +885,11 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L InvalidateRect( hWnd, NULL, FALSE ); break;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10002; + break; + case BM_SETSTYLE: { DWORD new_btn_type; diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index c554ac4e50b..7c171af8af1 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -2445,6 +2445,23 @@ static void test_visual(void) DestroyWindow(parent); }
+static void test_getobject(void) +{ + HWND hwnd; + LONG idx; + + hwnd = create_button(BS_PUSHBUTTON, NULL); + + idx = SendMessageA(hwnd, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(idx == 0x10002, "Expect idx 0x%08x, got 0x%08lx\n", 0x10002, idx); + + /* Check with upper 32 bits truncated */ + idx = SendMessageA(hwnd, WM_GETOBJECT, 0, (DWORD)OBJID_QUERYCLASSNAMEIDX); + ok(idx == 0x10002, "Expect idx 0x%08x, got 0x%08lx\n", 0x10002, idx); + + DestroyWindow(hwnd); +} + START_TEST(button) { BOOL (WINAPI * pIsThemeActive)(VOID); @@ -2482,6 +2499,7 @@ START_TEST(button) test_bcm_get_ideal_size(); test_style(); test_visual(); + test_getobject();
uninit_winevent_hook();
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148897
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000012800E0, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
This merge request was approved by Zhiyi Zhang.
@nsivov Do you plan on reviewing this? Just double-checking since you removed yourself from an earlier comctl32 MR.
This merge request was approved by Nikolay Sivov.