diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c index 75d499b25e..331dc9a69f 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 */ @@ -643,20 +651,49 @@ 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. + if (!IsThemeActive()) /* Not Using Themes */ + { + TRACE("Not using themes.\n"); + 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); + } + else + { + // Redraw only the interior part of the bar. + IntRefeshScrollInterior(Window, nBar, psbi); + } + } + else /* Using Themes */ + { + TRACE("Using themes.\n"); 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; + /* 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); } - else - { - // Redraw only the interior part of the bar. - IntRefeshScrollInterior(Window, nBar, psbi); - } } // FIXME: Arrows /* else if( action & SA_SSI_REPAINT_ARROWS ) {