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.
-- v3: 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 | 65 +++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 29 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index bb3f1993a83..493fdd8ea36 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 ) { 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,12 @@ 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 & 0x80000000) + ok(objid == (classnameidx & 0x7fffffff), "Class %s has nameidx %lx, expected %lx\n", + name, objid, classnameidx & 0x7fffffff); + DestroyWindow(hwnd); } else @@ -420,40 +427,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 ); + check_class( "ComboBox", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10005 ); + check_class( "Edit", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10004 ); + check_class( "ListBox", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10000 ); + check_class( "ScrollBar", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x8001000a ); + check_class( "Static", 1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10003 ); + check_class( "ComboLBox", 1, CS_SAVEBITS | CS_DBLCLKS | CS_DROPSHADOW | CS_GLOBALCLASS, CS_DROPSHADOW, FALSE, 0x10000 ); }
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, 0x8001000e); + check_class(WC_COMBOBOXEXA, 1, CS_GLOBALCLASS, 0, FALSE, 0); + check_class(DATETIMEPICK_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0); + check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x80010011); + check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x80010010); + check_class(WC_IPADDRESSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0); + check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x80010013); + check_class(MONTHCAL_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0); + check_class(WC_NATIVEFONTCTLA, 1, CS_GLOBALCLASS, 0, FALSE, 0); + check_class(WC_PAGESCROLLERA, 1, CS_GLOBALCLASS, 0, FALSE, 0); + check_class(PROGRESS_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000d); + check_class(REBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0); + check_class(STATUSCLASSNAMEA, 1, CS_DBLCLKS | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000b); + check_class(WC_TABCONTROLA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000f); + check_class(TOOLBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000c); 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, 0x80010018); 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, 0x80010018); + check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x80010012); + check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x80010019); + check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x80010016); + check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0); }
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 493fdd8ea36..59577715115 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -438,7 +438,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, 0x8001000e); + check_class(ANIMATE_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000e); check_class(WC_COMBOBOXEXA, 1, CS_GLOBALCLASS, 0, FALSE, 0); check_class(DATETIMEPICK_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0); check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x80010011);
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 59577715115..c4afc5dbc6a 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -442,7 +442,7 @@ static void test_comctl32_classes(BOOL v6) check_class(WC_COMBOBOXEXA, 1, CS_GLOBALCLASS, 0, FALSE, 0); check_class(DATETIMEPICK_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0); check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x80010011); - check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x80010010); + check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10010); check_class(WC_IPADDRESSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0); check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x80010013); check_class(MONTHCAL_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0);
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 c4afc5dbc6a..936614b4da2 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -444,7 +444,7 @@ static void test_comctl32_classes(BOOL v6) check_class(WC_HEADERA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, v6 ? 0 : 0x80010011); check_class(HOTKEY_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10010); check_class(WC_IPADDRESSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0); - check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x80010013); + check_class(WC_LISTVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10013); check_class(MONTHCAL_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0); check_class(WC_NATIVEFONTCTLA, 1, CS_GLOBALCLASS, 0, FALSE, 0); check_class(WC_PAGESCROLLERA, 1, CS_GLOBALCLASS, 0, FALSE, 0);
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 936614b4da2..f41ec1851e2 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -454,9 +454,9 @@ static void test_comctl32_classes(BOOL v6) check_class(WC_TABCONTROLA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x1000f); check_class(TOOLBARCLASSNAMEA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x1000c); 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, 0x80010018); + check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS | CS_DROPSHADOW, CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW /* XP */, TRUE, 0x10018); else - check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x80010018); + check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018); check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x80010012); check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x80010019); check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x80010016); 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 f41ec1851e2..b7c7d5b6973 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -457,7 +457,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); else check_class(TOOLTIPS_CLASSA, 1, CS_DBLCLKS | CS_GLOBALCLASS | CS_SAVEBITS, CS_HREDRAW | CS_VREDRAW /* XP */, FALSE, 0x10018); - check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x80010012); + check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012); check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x80010019); check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x80010016); check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0); 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 b7c7d5b6973..d1dae677ecd 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -458,7 +458,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); check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012); - check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x80010019); + check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019); check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x80010016); check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0); } 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 d1dae677ecd..8880fe0648b 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -459,7 +459,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); check_class(TRACKBAR_CLASSA, 1, CS_GLOBALCLASS, 0, FALSE, 0x10012); check_class(WC_TREEVIEWA, 1, CS_DBLCLKS | CS_GLOBALCLASS, 0, FALSE, 0x10019); - check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x80010016); + check_class(UPDOWN_CLASSA, 1, CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0, FALSE, 0x10016); check_class("SysLink", v6, CS_GLOBALCLASS, 0, FALSE, 0); }
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;
Updated tests to use `check_class` because that seems to cover all the control classes already, and we don't need to do anything more than create the window. Leaving header controls out for now until we have v6 separation. I'm also not sure how to handle scrollbars since comctl32 doesn't seem to have an implementation of those.
Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/tests/misc.c:
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);
All the OBJID_QUERYCLASSNAMEIDX tests previously added in other files can be deleted now.
Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/tests/misc.c:
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 & 0x80000000)
So 0x80000000 is a field to mark todos? Please use a dedicated variable like todo_queryclassnameid to mark todos for OBJID_QUERYCLASSNAMEIDX.