From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/tests/misc.c | 4 ---- dlls/comctl32/toolbar.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 2b6bdf81435..4e33a4cc8dd 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1383,7 +1383,6 @@ static void test_CCM_SETVERSION(BOOL v6) ok(hwnd != NULL, "CreateWindowA failed, error %lu.\n", GetLastError());
lr = SendMessageA(hwnd, CCM_GETVERSION, 0, 0); - todo_wine_if(lr != (v6 ? 6 : 0)) ok(lr == (v6 ? 6 : 0), "Got unexpected %Id.\n", lr);
for (j = 0; j <= 7; j++) @@ -1393,16 +1392,13 @@ static void test_CCM_SETVERSION(BOOL v6) lr = SendMessageA(hwnd, CCM_SETVERSION, j, 0); if (v6) { - todo_wine_if(lr != 6) ok(lr == 6, "Got unexpected %Id.\n", lr); } else { if (j >= 6) - todo_wine_if(lr != -1) ok(lr == -1, "Got unexpected %Id.\n", lr); else - todo_wine_if(lr != (j == 0 ? 0 : (j - 1))) ok(lr == (j == 0 ? 0 : (j - 1)), "Got unexpected %Id.\n", lr); }
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 5922afd729a..2c5ce1a7840 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -5117,10 +5117,17 @@ TOOLBAR_SetColorScheme (TOOLBAR_INFO *infoPtr, const COLORSCHEME *lParam) static LRESULT TOOLBAR_SetVersion (TOOLBAR_INFO *infoPtr, INT iVersion) { +#if __WINE_COMCTL32_VERSION == 6 + return infoPtr->iVersion; +#else INT iOldVersion = infoPtr->iVersion;
+ if (iVersion > 5) + return -1; + infoPtr->iVersion = iVersion; return iOldVersion; +#endif }
@@ -6056,7 +6063,11 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, const CREATESTRUCTW *lpcs) infoPtr->dwDTFlags = (lpcs->style & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS: DT_CENTER | DT_END_ELLIPSIS; infoPtr->bAnchor = FALSE; /* no anchor highlighting */ infoPtr->bDragOutSent = FALSE; +#if __WINE_COMCTL32_VERSION == 6 + infoPtr->iVersion = 6; +#else infoPtr->iVersion = 0; +#endif infoPtr->hwndSelf = hwnd; infoPtr->bDoRedraw = TRUE; infoPtr->clrBtnHighlight = CLR_DEFAULT;