diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c index e4e0ba436a..410ac682bd 100644 --- a/win32ss/user/ntuser/scrollbar.c +++ b/win32ss/user/ntuser/scrollbar.c @@ -10,6 +10,14 @@ #include DBG_DEFAULT_CHANNEL(UserScrollbar); +BOOL IsThemeActive(void) +{ + WCHAR tmp[2] = L"0"; + RegReadUserSetting(L"Software\\Microsoft\\Windows\\CurrentVersion\\ThemeManager", + L"ThemeActive", REG_SZ, (LPBYTE)tmp, sizeof(tmp)); + return (tmp[0] != '0'); +} + /* Definitions for scrollbar hit testing [See SCROLLBARINFO in MSDN] */ #define SCROLL_NOWHERE 0x00 /* Outside the scroll bar */ #define SCROLL_TOP_ARROW 0x01 /* Top or left arrow */ @@ -497,6 +505,17 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) static DWORD PrevPos[3] = { 0 }; static DWORD PrevMax[3] = { 0 }; static INT PrevAction[3] = { 0 }; + static PWND PrevWin[3] = { 0 }; + static BOOL ThemeActive; + + /* See if Window has changed */ + if (Window != PrevWin[0] && Window !=PrevWin[1]) + { + ERR("Window Change: Window is '%p' and Prev Window was '%p'.\n", + Window, PrevHwnd[nBar]); + PrevWin[nBar] = Window; + ThemeActive = IsThemeActive(); + } ASSERT_REFS_CO(Window); @@ -660,7 +679,7 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) return lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos; /* SetWindowPos() already did the painting */ if (bRedraw) { - if (!(lpsi->fMask & SIF_THEMED)) /* Not Using Themes */ + if (!ThemeActive) { TRACE("Not using themes.\n"); if (action & SA_SSI_REPAINT_ARROWS)