user32: Turn the scrollbar winproc into a Wow handler.

This commit is contained in:
Alexandre Julliard 2009-12-15 13:19:30 +01:00
parent 57e5c8f67a
commit 3dc6317fc6
4 changed files with 46 additions and 40 deletions

View File

@ -65,6 +65,7 @@ struct wow_handlers16
LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
}; };
struct wow_handlers32 struct wow_handlers32
@ -73,6 +74,7 @@ struct wow_handlers32
LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
}; };
extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN; extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
@ -81,6 +83,7 @@ extern LRESULT ButtonWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDE
extern LRESULT ComboWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN; extern LRESULT ComboWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT EditWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN; extern LRESULT EditWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT ListBoxWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN; extern LRESULT ListBoxWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern void register_wow_handlers(void) DECLSPEC_HIDDEN; extern void register_wow_handlers(void) DECLSPEC_HIDDEN;
extern void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, extern void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new,

View File

@ -1159,6 +1159,38 @@ static LRESULT listbox_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
} }
/***********************************************************************
* scrollbar_proc16
*/
static LRESULT scrollbar_proc16( 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;
wow_handlers32.scrollbar_proc( hwnd, SBM_GETRANGE, (WPARAM)&min, (LPARAM)&max, FALSE );
return MAKELRESULT(min, max);
}
default:
return wow_handlers32.scrollbar_proc( hwnd, msg, wParam, lParam, unicode );
}
return wow_handlers32.scrollbar_proc( hwnd, msg, wParam, lParam, FALSE );
}
void register_wow_handlers(void) void register_wow_handlers(void)
{ {
static const struct wow_handlers16 handlers16 = static const struct wow_handlers16 handlers16 =
@ -1167,6 +1199,7 @@ void register_wow_handlers(void)
combo_proc16, combo_proc16,
edit_proc16, edit_proc16,
listbox_proc16, listbox_proc16,
scrollbar_proc16,
}; };
UserRegisterWowHandlers( &handlers16, &wow_handlers32 ); UserRegisterWowHandlers( &handlers16, &wow_handlers32 );

View File

@ -33,7 +33,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
#include "wine/winuser16.h"
#include "controls.h" #include "controls.h"
#include "win.h" #include "win.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -1401,9 +1400,9 @@ static BOOL SCROLL_SetScrollRange(HWND hwnd, INT nBar, INT minVal, INT maxVal)
/*********************************************************************** /***********************************************************************
* ScrollBarWndProc * ScrollBarWndProc_common
*/ */
static LRESULT ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode ) LRESULT ScrollBarWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode )
{ {
if (!IsWindow( hwnd )) return 0; if (!IsWindow( hwnd )) return 0;
@ -1575,43 +1574,12 @@ 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 * ScrollBarWndProcA
*/ */
static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{ {
return ScrollBarWndProc_wrapper16( hwnd, message, wParam, lParam, FALSE ); return wow_handlers.scrollbar_proc( hwnd, message, wParam, lParam, FALSE );
} }
@ -1620,7 +1588,7 @@ static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT message, WPARAM wParam,
*/ */
static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{ {
return ScrollBarWndProc_wrapper16( hwnd, message, wParam, lParam, TRUE ); return wow_handlers.scrollbar_proc( hwnd, message, wParam, lParam, TRUE );
} }

View File

@ -2388,10 +2388,11 @@ INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam,
*/ */
void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wow_handlers32 *orig ) void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wow_handlers32 *orig )
{ {
orig->button_proc = ButtonWndProc_common; orig->button_proc = ButtonWndProc_common;
orig->combo_proc = ComboWndProc_common; orig->combo_proc = ComboWndProc_common;
orig->edit_proc = EditWndProc_common; orig->edit_proc = EditWndProc_common;
orig->listbox_proc = ListBoxWndProc_common; orig->listbox_proc = ListBoxWndProc_common;
orig->scrollbar_proc = ScrollBarWndProc_common;
wow_handlers = *new; wow_handlers = *new;
} }
@ -2402,4 +2403,5 @@ struct wow_handlers16 wow_handlers =
ComboWndProc_common, ComboWndProc_common,
EditWndProc_common, EditWndProc_common,
ListBoxWndProc_common, ListBoxWndProc_common,
ScrollBarWndProc_common,
}; };