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.
-- v4: comctl32/tests: Remove individual OBJID_QUERYCLASSNAMEIDX tests. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for updown controls. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for treeviews. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for trackbar controls. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for tooltips. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for listviews. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for hotkey controls. comctl32: Implement OBJID_QUERYCLASSNAMEIDX for Animate controls. comctl32/tests: Add general tests for OBJID_QUERYCLASSNAMEIDX.
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/misc.c | 71 ++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 29 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index bb3f1993a83..c04308fd057 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -385,7 +385,7 @@ static void test_LoadIconWithScaleDown(void) FreeLibrary(hinst); }
-static void check_class( const char *name, int must_exist, UINT style, UINT ignore, BOOL v6 ) +static void check_class( const char *name, int must_exist, UINT style, UINT ignore, BOOL v6, DWORD classnameidx, BOOL classnameidx_todo ) { WNDCLASSA wc;
@@ -393,6 +393,7 @@ static void check_class( const char *name, int must_exist, UINT style, UINT igno { char buff[64]; HWND hwnd; + DWORD objid;
todo_wine_if(!strcmp(name, "SysLink") && !must_exist && !v6) ok( must_exist, "System class %s should %sexist\n", name, must_exist ? "" : "NOT " ); @@ -410,6 +411,18 @@ static void check_class( const char *name, int must_exist, UINT style, UINT igno ok( hwnd != NULL, "Failed to create window for class %s.\n", name ); GetClassNameA(hwnd, buff, ARRAY_SIZE(buff)); ok( !strcmp(name, buff), "Unexpected class name %s, expected %s.\n", buff, name ); + + objid = SendMessageA(hwnd, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); + todo_wine_if(classnameidx_todo) + ok(objid == classnameidx, "Class %s has nameidx %lx, expected %lx\n", + name, objid, classnameidx); + + /* Check with upper 32 bits truncated */ + objid = SendMessageA(hwnd, WM_GETOBJECT, 0, (DWORD)OBJID_QUERYCLASSNAMEIDX); + todo_wine_if(classnameidx_todo) + ok(objid == classnameidx, "Class %s has nameidx %lx, expected %lx\n", + name, objid, classnameidx); + DestroyWindow(hwnd); } else @@ -420,40 +433,40 @@ static void check_class( const char *name, int must_exist, UINT style, UINT igno static void test_builtin_classes(void) { /* check style bits */ - check_class( "Button", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE ); - check_class( "ComboBox", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE ); - check_class( "Edit", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE ); - check_class( "ListBox", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE ); - check_class( "ScrollBar", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE ); - check_class( "Static", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE ); - check_class( "ComboLBox", 1, CS_SAVEBITS | CS_DBLCLKS | CS_DROPSHADOW | CS_GLOBALCLASS, CS_DROPSHADOW, FALSE ); + check_class( "Button", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10002, FALSE ); + check_class( "ComboBox", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10005, FALSE ); + check_class( "Edit", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10004, FALSE ); + check_class( "ListBox", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10000, FALSE ); + check_class( "ScrollBar", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000a, TRUE ); + check_class( "Static", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10003, FALSE ); + check_class( "ComboLBox", 1, CS_SAVEBITS | CS_DBLCLKS | CS_DROPSHADOW | CS_GLOBALCLASS, CS_DROPSHADOW, FALSE, 0x10000, FALSE ); }
static void test_comctl32_classes(BOOL v6) { - check_class(ANIMATE_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE); - check_class(WC_COMBOBOXEXA, 1, CS_GLOBALCLASS, 0, FALSE); - check_class(DATETIMEPICK_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE); - check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE); - check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE); - check_class(WC_IPADDRESSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE); - check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE); - check_class(MONTHCAL_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE); - check_class(WC_NATIVEFONTCTLA, 1, CS_GLOBALCLASS, 0, FALSE); - check_class(WC_PAGESCROLLERA, 1, CS_GLOBALCLASS, 0, FALSE); - check_class(PROGRESS_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE); - check_class(REBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE); - check_class(STATUSCLASSNAMEA, 1, CS_DBLCLKS | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE); - check_class(WC_TABCONTROLA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE); - check_class(TOOLBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE); + check_class(ANIMATE_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000e, TRUE); + check_class(WC_COMBOBOXEXA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); + check_class(DATETIMEPICK_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); + check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x10011, !v6); + check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10010, TRUE); + check_class(WC_IPADDRESSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0, FALSE); + check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10013, TRUE); + check_class(MONTHCAL_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); + check_class(WC_NATIVEFONTCTLA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); + check_class(WC_PAGESCROLLERA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); + check_class(PROGRESS_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000d, FALSE); + check_class(REBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0, FALSE); + check_class(STATUSCLASSNAMEA, 1, CS_DBLCLKS | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000b, FALSE); + check_class(WC_TABCONTROLA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000f, FALSE); + check_class(TOOLBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000c, FALSE); if (v6) - check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS | CS_DROPSHADOW, CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW /* XP */, TRUE); + check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS | CS_DROPSHADOW, CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW /* XP */, TRUE, 0x10018, TRUE); else - check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE); - check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE); - check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE); - check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE); - check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE); + check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018, TRUE); + check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012, TRUE); + check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019, TRUE); + check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10016, TRUE); + check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); }
struct wm_themechanged_test
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/animate.c | 5 +++++ dlls/comctl32/tests/misc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index 46e1e37b72d..a3603b8bfbe 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -899,6 +899,11 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP case WM_ERASEBKGND: return ANIMATE_EraseBackground(infoPtr, (HDC)wParam);
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x1000e; + return DefWindowProcW(hWnd, uMsg, wParam, lParam); + case WM_STYLECHANGED: return ANIMATE_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index c04308fd057..9f3b664f384 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -444,7 +444,7 @@ static void test_builtin_classes(void)
static void test_comctl32_classes(BOOL v6) { - check_class(ANIMATE_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000e, TRUE); + check_class(ANIMATE_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000e, FALSE); check_class(WC_COMBOBOXEXA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); check_class(DATETIMEPICK_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x10011, !v6);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/hotkey.c | 5 +++++ dlls/comctl32/tests/misc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/hotkey.c b/dlls/comctl32/hotkey.c index 1fc9658c179..a3a8a8ce6b4 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; + return DefWindowProcW (hwnd, uMsg, wParam, lParam); + case WM_GETFONT: return HOTKEY_GetFont (infoPtr);
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 9f3b664f384..640f5d0d012 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -448,7 +448,7 @@ static void test_comctl32_classes(BOOL v6) check_class(WC_COMBOBOXEXA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); check_class(DATETIMEPICK_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x10011, !v6); - check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10010, TRUE); + check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10010, FALSE); check_class(WC_IPADDRESSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0, FALSE); check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10013, TRUE); check_class(MONTHCAL_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/listview.c | 5 +++++ dlls/comctl32/tests/misc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
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/misc.c b/dlls/comctl32/tests/misc.c index 640f5d0d012..de984e9ff57 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -450,7 +450,7 @@ static void test_comctl32_classes(BOOL v6) check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x10011, !v6); check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10010, FALSE); check_class(WC_IPADDRESSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0, FALSE); - check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10013, TRUE); + check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10013, FALSE); check_class(MONTHCAL_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); check_class(WC_NATIVEFONTCTLA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); check_class(WC_PAGESCROLLERA, 1, CS_GLOBALCLASS, 0, FALSE, 0, FALSE);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/misc.c | 4 ++-- dlls/comctl32/tooltips.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index de984e9ff57..64159aacac5 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -460,9 +460,9 @@ static void test_comctl32_classes(BOOL v6) check_class(WC_TABCONTROLA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000f, FALSE); check_class(TOOLBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000c, FALSE); if (v6) - check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS | CS_DROPSHADOW, CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW /* XP */, TRUE, 0x10018, TRUE); + check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS | CS_DROPSHADOW, CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW /* XP */, TRUE, 0x10018, FALSE); else - check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018, TRUE); + check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018, FALSE); check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012, TRUE); check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019, TRUE); check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10016, TRUE); 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/misc.c | 2 +- dlls/comctl32/trackbar.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 64159aacac5..885fe9f8c60 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -463,7 +463,7 @@ static void test_comctl32_classes(BOOL v6) check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS | CS_DROPSHADOW, CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW /* XP */, TRUE, 0x10018, FALSE); else check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018, FALSE); - check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012, TRUE); + check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012, FALSE); check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019, TRUE); check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10016, TRUE); check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); 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/tests/misc.c | 2 +- dlls/comctl32/treeview.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 885fe9f8c60..d14714e48f1 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -464,7 +464,7 @@ static void test_comctl32_classes(BOOL v6) else check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018, FALSE); check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012, FALSE); - check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019, TRUE); + check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019, FALSE); check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10016, TRUE); check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); } diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 073f62c66a2..bf9bad4715e 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -5859,6 +5859,11 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETDLGCODE: return DLGC_WANTARROWS | DLGC_WANTCHARS;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10019; + return DefWindowProcW(hwnd, uMsg, wParam, lParam); + case WM_GETFONT: return TREEVIEW_GetFont(infoPtr);
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/misc.c | 2 +- dlls/comctl32/updown.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index d14714e48f1..657376f49ce 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -465,7 +465,7 @@ static void test_comctl32_classes(BOOL v6) check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018, FALSE); check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012, FALSE); check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019, FALSE); - check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10016, TRUE); + check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10016, FALSE); check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0, FALSE); }
diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 775dcb4bd3c..284e3d91c9a 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -954,6 +954,11 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L InvalidateRect (infoPtr->Self, NULL, FALSE); break;
+ case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10016; + return DefWindowProcW (hwnd, message, wParam, lParam); + case WM_STYLECHANGED: if (wParam == GWL_STYLE) infoPtr->dwStyle = ((LPSTYLESTRUCT)lParam)->styleNew;
From: Esme Povirk esme@codeweavers.com
--- dlls/comctl32/tests/button.c | 18 ------------------ dlls/comctl32/tests/combo.c | 4 ---- dlls/comctl32/tests/edit.c | 4 ---- dlls/comctl32/tests/listbox.c | 4 ---- dlls/comctl32/tests/progress.c | 4 ---- dlls/comctl32/tests/static.c | 4 ---- dlls/comctl32/tests/status.c | 3 --- dlls/comctl32/tests/tab.c | 15 --------------- dlls/comctl32/tests/toolbar.c | 4 ---- 9 files changed, 60 deletions(-)
diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index 676062f0132..ff5d1ba388f 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -2445,23 +2445,6 @@ 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); -} - static void test_radiobutton_focus(void) { HWND hwnd, button; @@ -2618,7 +2601,6 @@ START_TEST(button) test_bcm_get_ideal_size(); test_style(); test_visual(); - test_getobject(); test_radiobutton_focus();
uninit_winevent_hook(); diff --git a/dlls/comctl32/tests/combo.c b/dlls/comctl32/tests/combo.c index ddb3eb4d78a..0ba720a03ce 100644 --- a/dlls/comctl32/tests/combo.c +++ b/dlls/comctl32/tests/combo.c @@ -1236,13 +1236,9 @@ static void test_combo_WS_VSCROLL(void) COMBOBOXINFO info; DWORD style; int i; - DWORD idx;
hCombo = create_combobox(CBS_DROPDOWNLIST);
- idx = SendMessageA(hCombo, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - ok(idx == 0x10005, "Got index 0x%08lx\n", idx); - get_combobox_info(hCombo, &info); hList = info.hwndList;
diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c index d0a9d1901a4..7e106662bb5 100644 --- a/dlls/comctl32/tests/edit.c +++ b/dlls/comctl32/tests/edit.c @@ -768,7 +768,6 @@ static void test_edit_control_1(void) MSG msMessage; int i; LONG r; - DWORD idx;
msMessage.message = WM_KEYDOWN;
@@ -777,9 +776,6 @@ static void test_edit_control_1(void) r = get_edit_style(hwEdit); ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL), "Wrong style expected 0xc0 got: 0x%lx\n", r);
- idx = SendMessageA(hwEdit, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - ok(idx == 0x10004, "Got index 0x%08lx\n", idx); - for (i = 0; i < 65535; i++) { msMessage.wParam = i; diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c index a52268ed586..8a9db99f386 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -372,7 +372,6 @@ static void test_item_height(void) HFONT font; HWND hLB; HDC hdc; - DWORD idx;
hLB = create_listbox (0, 0); ok ((hdc = GetDCEx( hLB, 0, DCX_CACHE )) != 0, "Can't get hdc\n"); @@ -380,9 +379,6 @@ static void test_item_height(void) ok (GetTextMetricsA( hdc, &tm ), "Can't read font metrics\n"); ReleaseDC( hLB, hdc);
- idx = SendMessageA(hLB, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - ok(idx == 0x10000, "Got index 0x%08lx\n", idx); - ok (SendMessageA(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set font\n");
itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c index 77517a194b3..f228ac84d2e 100644 --- a/dlls/comctl32/tests/progress.c +++ b/dlls/comctl32/tests/progress.c @@ -269,13 +269,9 @@ static void test_setcolors(void) { HWND progress; COLORREF clr; - DWORD idx;
progress = create_progress(PBS_SMOOTH);
- idx = SendMessageA(progress, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - ok(idx == 0x1000d, "Got index 0x%08lx\n", idx); - clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, 0); ok(clr == CLR_DEFAULT, "got %lx\n", clr);
diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c index d0c1da8818f..551aca2720f 100644 --- a/dlls/comctl32/tests/static.c +++ b/dlls/comctl32/tests/static.c @@ -135,10 +135,6 @@ static void test_set_text(void) { HWND hStatic = create_static(SS_SIMPLE); char buffA[10]; - DWORD idx; - - idx = SendMessageA(hStatic, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - ok(idx == 0x10003, "Got index 0x%08lx\n", idx);
GetWindowTextA(hStatic, buffA, sizeof(buffA)); ok(!strcmp(buffA, "Test"), "got wrong text %s\n", buffA); diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c index 272145d5772..ac24f91cbb8 100644 --- a/dlls/comctl32/tests/status.c +++ b/dlls/comctl32/tests/status.c @@ -270,9 +270,6 @@ static void test_status_control(void)
hWndStatus = create_status_control(WS_VISIBLE | SBT_TOOLTIPS, 0);
- r = SendMessageA(hWndStatus, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - expect(0x1000b, r); - /* Divide into parts and set text */ r = SendMessageA(hWndStatus, SB_SETPARTS, 3, (LPARAM)nParts); expect(TRUE,r); diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c index 933b4e0221a..34738b4d58c 100644 --- a/dlls/comctl32/tests/tab.c +++ b/dlls/comctl32/tests/tab.c @@ -1620,20 +1620,6 @@ static void test_TCM_GETROWCOUNT(void) DestroyWindow(hTab); }
-static void test_WM_GETOBJECT(void) -{ - HWND hTab; - DWORD objid; - - hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, 2); - ok(hTab != NULL, "Failed to create tab control\n"); - - objid = SendMessageA(hTab, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - ok(objid == 0x1000f, "Unexpected objid %lu.\n", objid); - - DestroyWindow(hTab); -} - START_TEST(tab) { LOGFONTA logfont; @@ -1673,7 +1659,6 @@ START_TEST(tab) test_create(); test_TCN_SELCHANGING(); test_TCM_GETROWCOUNT(); - test_WM_GETOBJECT();
uninit_winevent_hook();
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index 1b95fdfe853..ba2720ac0b4 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -513,7 +513,6 @@ static void basic_test(void) TBBUTTON buttons[9]; HWND hToolbar; int i; - DWORD idx;
for (i=0; i<9; i++) MakeButton(buttons+i, 1000+i, TBSTYLE_CHECKGROUP, 0); @@ -530,9 +529,6 @@ static void basic_test(void) ok(hToolbar != NULL, "Toolbar creation\n"); SendMessageA(hToolbar, TB_ADDSTRINGA, 0, (LPARAM)"test\000");
- idx = SendMessageA(hToolbar, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); - ok(idx == 0x1000c, "Got index 0x%08lx\n", idx); - /* test for exclusion working inside a separator-separated :-) group */ SendMessageA(hToolbar, TB_CHECKBUTTON, 1000, 1); /* press A1 */ ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n");
This merge request was approved by Zhiyi Zhang.