user32: Split the handling of the 16-bit messages out of the scrollbar winproc.

This commit is contained in:
Alexandre Julliard 2009-12-11 20:25:28 +01:00
parent 8b226ac4d6
commit 11ed5da3fd

View File

@ -1519,19 +1519,12 @@ static LRESULT ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM
}
break;
case SBM_SETPOS16:
case SBM_SETPOS:
return SetScrollPos( hwnd, SB_CTL, wParam, (BOOL)lParam );
case SBM_GETPOS16:
case SBM_GETPOS:
return SCROLL_GetScrollPos(hwnd, SB_CTL);
case SBM_SETRANGE16:
if (wParam) message = SBM_SETRANGEREDRAW;
wParam = LOWORD(lParam);
lParam = HIWORD(lParam);
/* fall through */
case SBM_SETRANGEREDRAW:
case SBM_SETRANGE:
{
@ -1543,18 +1536,9 @@ static LRESULT ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM
}
return 0;
case SBM_GETRANGE16:
{
INT min, max;
SCROLL_GetScrollRange(hwnd, SB_CTL, &min, &max);
return MAKELRESULT(min, max);
}
case SBM_GETRANGE:
return SCROLL_GetScrollRange(hwnd, SB_CTL, (LPINT)wParam, (LPINT)lParam);
case SBM_ENABLE_ARROWS16:
case SBM_ENABLE_ARROWS:
return EnableScrollBar( hwnd, SB_CTL, wParam );
@ -1591,12 +1575,43 @@ static LRESULT ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM
}
/***********************************************************************
* ScrollBarWndProc_wrapper16
*/
static LRESULT ScrollBarWndProc_wrapper16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode )
{
static const UINT msg16_offset = SBM_SETPOS16 - SBM_SETPOS;
switch (msg)
{
case SBM_SETPOS16:
case SBM_GETPOS16:
case SBM_ENABLE_ARROWS16:
msg -= msg16_offset;
break;
case SBM_SETRANGE16:
msg = wParam ? SBM_SETRANGEREDRAW : SBM_SETRANGE;
wParam = LOWORD(lParam);
lParam = HIWORD(lParam);
break;
case SBM_GETRANGE16:
{
INT min, max;
ScrollBarWndProc( hwnd, SBM_GETRANGE, (WPARAM)&min, (LPARAM)&max, FALSE );
return MAKELRESULT(min, max);
}
default:
return ScrollBarWndProc( hwnd, msg, wParam, lParam, unicode );
}
return ScrollBarWndProc( hwnd, msg, wParam, lParam, FALSE );
}
/***********************************************************************
* ScrollBarWndProcA
*/
static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
return ScrollBarWndProc( hwnd, message, wParam, lParam, FALSE );
return ScrollBarWndProc_wrapper16( hwnd, message, wParam, lParam, FALSE );
}
@ -1605,7 +1620,7 @@ static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT message, WPARAM wParam,
*/
static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
return ScrollBarWndProc( hwnd, message, wParam, lParam, TRUE );
return ScrollBarWndProc_wrapper16( hwnd, message, wParam, lParam, TRUE );
}