From aa5b6ce836c39eef46b977fc981612bbc104a727 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Thu, 31 May 2001 21:30:06 +0000 Subject: [PATCH] Fixed scrollbars return value to the SBM_SETRANGE and SBM_SETRANGEREDRAW messages. --- controls/scroll.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/controls/scroll.c b/controls/scroll.c index 40b653642be..7286cfe6f6f 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -1256,8 +1256,12 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, return 0; case SBM_SETRANGE: - SetScrollRange( hwnd, SB_CTL, wParam, lParam, FALSE ); - return 0; /* FIXME: return previous position */ + { + INT oldPos = GetScrollPos( hwnd, SB_CTL ); + SetScrollRange( hwnd, SB_CTL, wParam, lParam, FALSE ); + if (oldPos != GetScrollPos( hwnd, SB_CTL )) return oldPos; + } + return 0; case SBM_GETRANGE16: FIXME("don't know how to handle SBM_GETRANGE16 (wp=%04x,lp=%08lx)\n", wParam, lParam ); @@ -1272,9 +1276,13 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, return EnableScrollBar( hwnd, SB_CTL, wParam ); case SBM_SETRANGEREDRAW: - SetScrollRange( hwnd, SB_CTL, wParam, lParam, TRUE ); - return 0; /* FIXME: return previous position */ - + { + INT oldPos = GetScrollPos( hwnd, SB_CTL ); + SetScrollRange( hwnd, SB_CTL, wParam, lParam, TRUE ); + if (oldPos != GetScrollPos( hwnd, SB_CTL )) return oldPos; + } + return 0; + case SBM_SETSCROLLINFO: return SetScrollInfo( hwnd, SB_CTL, (SCROLLINFO *)lParam, wParam );