diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c index 75d499b25e..b763475dc7 100644 --- a/win32ss/user/ntuser/scrollbar.c +++ b/win32ss/user/ntuser/scrollbar.c @@ -10,6 +10,26 @@ #include DBG_DEFAULT_CHANNEL(UserScrollbar); +BOOL IsThemeActive(void) +{ + BOOL bActive; + LRESULT Result; + WCHAR tmp[3] = L""; + DWORD buffsize = sizeof(tmp); + bActive = FALSE; + Result = RegReadUserSetting(L"Software\\Microsoft\\Windows\\CurrentVersion\\ThemeManager", + L"ThemeActive", REG_SZ, (LPBYTE)tmp, buffsize); + if (Result) + { + bActive = (!wcscmp(tmp, L"1")); + } + else + { + ERR("RegReadUserSetting Failed.\n"); + } + return bActive; +} + /* 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 */ @@ -643,19 +663,43 @@ 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 (action & SA_SSI_REPAINT_ARROWS) - { // Redraw the entire bar. - RECTL UpdateRect = psbi->rcScrollBar; - UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left; - UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left; - UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top; - UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top; - co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); + RECTL UpdateRect = psbi->rcScrollBar; + UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left; + UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left; + UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top; + UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top; + + if (!IsThemeActive()) /* Not Using Themes */ + { + TRACE("Not using themes.\n"); + if (action & SA_SSI_REPAINT_ARROWS) + { // Redraw the entire bar. + co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); + } + else + { + // Redraw only the interior part of the bar. + IntRefeshScrollInterior(Window, nBar, psbi); + } } - else + else /* Using Themes */ { - // Redraw only the interior part of the bar. - IntRefeshScrollInterior(Window, nBar, psbi); + TRACE("Using themes.\n"); + /* Just paint the interior and not the arrows. */ + if (!(action & SA_SSI_REPAINT_ARROWS)) + { + if (nBar == SB_HORZ) + { + UpdateRect.left += psbi->dxyLineButton; + UpdateRect.right -= psbi->dxyLineButton; + } + if (nBar == SB_VERT) + { + UpdateRect.top += psbi->dxyLineButton; + UpdateRect.bottom -= psbi->dxyLineButton; + } + } + co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); } } // FIXME: Arrows /* else if( action & SA_SSI_REPAINT_ARROWS )