The header controls are a bit weird. It seems v6 returns 0 for this, but unlike v5 it has its own IAccessible implementation. Since Wine doesn't have that yet, and we can't easily change behavior based on version, I think it makes sense to return a value.
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/hotkey.c | 5 +++++ dlls/comctl32/tests/misc.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+)
diff --git a/dlls/comctl32/hotkey.c b/dlls/comctl32/hotkey.c index 1fc9658c179..9d3470fdc4a 100644 --- a/dlls/comctl32/hotkey.c +++ b/dlls/comctl32/hotkey.c @@ -543,6 +543,11 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETDLGCODE: return DLGC_WANTCHARS | DLGC_WANTARROWS;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10010; + break; + case WM_GETFONT: return HOTKEY_GetFont (infoPtr);
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index bb3f1993a83..5e6e75ef9ab 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1271,6 +1271,21 @@ static void test_WM_SETFONT(void) DestroyWindow(parent); }
+static void test_WM_GETOBJECT(void) +{ + HWND hwnd; + DWORD objid; + + hwnd = CreateWindowA(HOTKEY_CLASSA, "test", WS_POPUP, 100, 100, 100, 100, + 0, 0, 0, 0); + ok(hwnd != NULL, "CreateWindowA failed, error %lu.\n", GetLastError()); + + objid = SendMessageA(hwnd, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(objid == 0x10010, "Unexpected objid %lu.\n", objid); + + DestroyWindow(hwnd); +} + START_TEST(misc) { ULONG_PTR ctx_cookie; @@ -1301,6 +1316,7 @@ START_TEST(misc) test_WM_SYSCOLORCHANGE(); test_WM_STYLECHANGED(); test_WM_SETFONT(); + test_WM_GETOBJECT();
unload_v6_module(ctx_cookie, hCtx); FreeLibrary(hComctl32);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/header.c | 5 +++++ dlls/comctl32/tests/header.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 354ca615500..810dd030f31 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -2219,6 +2219,11 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_GETDLGCODE: return DLGC_WANTTAB | DLGC_WANTARROWS;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10011; + return DefWindowProcW(hwnd, msg, wParam, lParam); + case WM_GETFONT: return HEADER_GetFont (infoPtr);
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index dff58cef624..0b280a472a7 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -605,15 +605,22 @@ static void header_item_getback(HWND hwnd, UINT mask, HDITEMA *item) ok(ret != 0, "Failed to delete item.\n"); }
-static void test_item_auto_format(HWND parent) +static void test_item_auto_format(HWND parent, BOOL is_v6) { static char text[] = "Test"; HDITEMA item; HBITMAP hbm; HWND hwnd; + DWORD objid;
hwnd = create_custom_header_control(parent, FALSE);
+ objid = SendMessageA(hwnd, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + if (is_v6) + todo_wine ok(objid == 0, "Unexpected objid %lu.\n", objid); + else + ok(objid == 0x10011, "Unexpected objid %lu.\n", objid); + /* Windows implicitly sets some format bits in INSERTITEM */
/* HDF_STRING is automatically set and cleared for no text */ @@ -1905,7 +1912,7 @@ START_TEST(header) return;
test_header_control(); - test_item_auto_format(hHeaderParentWnd); + test_item_auto_format(hHeaderParentWnd, FALSE); test_header_order(); test_hdm_orderarray(); test_customdraw(); @@ -1938,7 +1945,7 @@ START_TEST(header) /* comctl32 version 6 tests start here */ test_hdf_fixedwidth(parent_hwnd); test_hds_nosizing(parent_hwnd); - test_item_auto_format(parent_hwnd); + test_item_auto_format(parent_hwnd, TRUE); test_hdm_layout(parent_hwnd);
uninit_winevent_hook();
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/trackbar.c | 4 ++++ dlls/comctl32/trackbar.c | 5 +++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/comctl32/tests/trackbar.c b/dlls/comctl32/tests/trackbar.c index 86fb1ce1898..672c3882c47 100644 --- a/dlls/comctl32/tests/trackbar.c +++ b/dlls/comctl32/tests/trackbar.c @@ -547,10 +547,14 @@ static void test_trackbar_buddy(void) HWND hWndRightBuddy; HWND hWndCurrentBuddy; HWND rTest; + DWORD objid;
hWndTrackbar = create_trackbar(defaultstyle, hWndParent); ok(hWndTrackbar != NULL, "Expected non NULL value\n");
+ objid = SendMessageA(hWndTrackbar, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(objid == 0x10012, "Unexpected objid %lu.\n", objid); + flush_sequences(sequences, NUM_MSG_SEQUENCE);
hWndLeftBuddy = CreateWindowA(STATUSCLASSNAMEA, NULL, 0, 0, 0, 300, 20, NULL, NULL, NULL, NULL); diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 461f3f3e437..2cc1f747e1f 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -2014,6 +2014,11 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETDLGCODE: return DLGC_WANTARROWS;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10012; + return DefWindowProcW (hwnd, uMsg, wParam, lParam); + case WM_KEYDOWN: return TRACKBAR_KeyDown (infoPtr, (INT)wParam);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/listview.c | 5 +++++ dlls/comctl32/tests/listview.c | 4 ++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index fd2abfd1928..b2856db471c 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -11862,6 +11862,11 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETFONT: return (LRESULT)infoPtr->hFont;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10013; + return DefWindowProcW(hwnd, uMsg, wParam, lParam); + case WM_HSCROLL: return LISTVIEW_HScroll(infoPtr, (INT)LOWORD(wParam), 0);
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 951def8fe0f..cea730a76c4 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -1086,6 +1086,7 @@ static void test_images(void) HIMAGELIST himl; HBITMAP hbmp; RECT r1, r2; + DWORD objid; static CHAR hello[] = "hello";
himl = pImageList_Create(40, 40, 0, 4, 4); @@ -1101,6 +1102,9 @@ static void test_images(void) 10, 10, 100, 200, hwndparent, NULL, NULL, NULL); ok(hwnd != NULL, "failed to create listview window\n");
+ objid = SendMessageA(hwnd, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(objid == 0x10013, "Unexpected objid %lu.\n", objid); + r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_UNDERLINEHOT | LVS_EX_FLATSB | LVS_EX_ONECLICKACTIVATE);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/updown.c | 4 ++++ dlls/comctl32/updown.c | 5 +++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index d863e2692e0..6920f6a9fc1 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c @@ -835,6 +835,7 @@ static void test_updown_create(void) CHAR text[MAX_PATH]; HWND updown; RECT r; + DWORD objid;
flush_sequences(sequences, NUM_MSG_SEQUENCES);
@@ -843,6 +844,9 @@ static void test_updown_create(void) ok_sequence(sequences, PARENT_SEQ_INDEX, add_updown_to_parent_seq, "add updown control to parent", TRUE); ok_sequence(sequences, EDIT_SEQ_INDEX, add_updown_with_edit_seq, "add updown control with edit", FALSE);
+ objid = SendMessageA(updown, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(objid == 0x10016, "Unexpected objid %lu.\n", objid); + flush_sequences(sequences, NUM_MSG_SEQUENCES);
GetWindowTextA(g_edit, text, MAX_PATH); diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 775dcb4bd3c..0a2e760216b 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -1042,6 +1042,11 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L return UPDOWN_KeyPressed(infoPtr, (int)wParam); break;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10016; + break; + case WM_PRINTCLIENT: case WM_PAINT: return UPDOWN_Paint (infoPtr, (HDC)wParam);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/tooltips.c | 4 ++++ dlls/comctl32/tooltips.c | 5 +++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index d34f83806b5..0b524195b50 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -41,6 +41,7 @@ static void test_create_tooltip(BOOL is_v6) { HWND parent, hwnd; DWORD style, exp_style; + DWORD objid;
parent = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 0, 0, @@ -52,6 +53,9 @@ static void test_create_tooltip(BOOL is_v6) parent, NULL, NULL, 0); ok(hwnd != NULL, "failed to create tooltip wnd\n");
+ objid = SendMessageA(hwnd, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(objid == 0x10018, "Unexpected objid %lu.\n", objid); + style = GetWindowLongA(hwnd, GWL_STYLE); exp_style = 0x7fffffff | WS_POPUP; exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME); diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index 1d8ac3463ab..028b4c8e57c 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -2241,6 +2241,11 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETFONT: return TOOLTIPS_GetFont (infoPtr);
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10018; + return DefWindowProcW (hwnd, uMsg, wParam, lParam); + case WM_GETTEXT: return TOOLTIPS_OnWMGetText (infoPtr, wParam, (LPWSTR)lParam);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/treeview.c | 4 ++++ dlls/comctl32/treeview.c | 5 +++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 5b53a32f51b..196b1cda520 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -501,9 +501,13 @@ static void test_fillroot(void) { TVITEMA tvi; HWND hTree; + DWORD objid;
hTree = create_treeview_control(0);
+ objid = SendMessageA(hTree, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + ok(objid == 0x10019, "Unexpected objid %lu.\n", objid); + flush_sequences(sequences, NUM_MSG_SEQUENCES);
fill_tree(hTree); diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 073f62c66a2..22396c83f4b 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -5862,6 +5862,11 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETFONT: return TREEVIEW_GetFont(infoPtr);
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10019; + goto def; + case WM_HSCROLL: return TREEVIEW_HScroll(infoPtr, wParam);
What's the logic behind calling default procedure for some controls and not for others?
The intent was to call it in all cases, but sometimes there's a call at the end of the switch. If I have a `break` that doesn't flow into one, that's my mistake.
Ah I see, I missed that updown ends in a "return 0", I'll fix that.