user32: Turn the static winproc into a Wow handler.

This commit is contained in:
Alexandre Julliard 2009-12-15 13:19:53 +01:00
parent 3dc6317fc6
commit 8649f73056
4 changed files with 27 additions and 22 deletions

View File

@ -66,6 +66,7 @@ struct wow_handlers16
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
};
struct wow_handlers32
@ -75,6 +76,7 @@ struct wow_handlers32
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
};
extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
@ -84,6 +86,7 @@ extern LRESULT ComboWndProc_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 ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern void register_wow_handlers(void) DECLSPEC_HIDDEN;
extern void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new,

View File

@ -1191,6 +1191,24 @@ static LRESULT scrollbar_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
}
/***********************************************************************
* static_proc16
*/
static LRESULT static_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode )
{
switch (msg)
{
case STM_SETICON16:
wParam = (WPARAM)HICON_32( (HICON16)wParam );
return wow_handlers32.static_proc( hwnd, STM_SETICON, wParam, lParam, FALSE );
case STM_GETICON16:
return HICON_16( wow_handlers32.static_proc( hwnd, STM_GETICON, wParam, lParam, FALSE ));
default:
return wow_handlers32.static_proc( hwnd, msg, wParam, lParam, unicode );
}
}
void register_wow_handlers(void)
{
static const struct wow_handlers16 handlers16 =
@ -1200,6 +1218,7 @@ void register_wow_handlers(void)
edit_proc16,
listbox_proc16,
scrollbar_proc16,
static_proc16,
};
UserRegisterWowHandlers( &handlers16, &wow_handlers32 );

View File

@ -47,7 +47,6 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "controls.h"
#include "user_private.h"
#include "wine/debug.h"
@ -400,8 +399,7 @@ static BOOL hasTextStyle( DWORD style )
/***********************************************************************
* StaticWndProc_common
*/
static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam, BOOL unicode )
LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode )
{
LRESULT lResult = 0;
LONG full_style = GetWindowLongW( hwnd, GWL_STYLE );
@ -606,30 +604,13 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
return lResult;
}
/***********************************************************************
* StaticWndProc_wrapper16
*/
static LRESULT StaticWndProc_wrapper16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode )
{
switch (msg)
{
case STM_SETICON16:
wParam = (WPARAM)HICON_32( (HICON16)wParam );
return StaticWndProc_common( hwnd, STM_SETICON, wParam, lParam, FALSE );
case STM_GETICON16:
return HICON_16( StaticWndProc_common( hwnd, STM_GETICON, wParam, lParam, FALSE ));
default:
return StaticWndProc_common( hwnd, msg, wParam, lParam, unicode );
}
}
/***********************************************************************
* StaticWndProcA
*/
static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
if (!IsWindow( hWnd )) return 0;
return StaticWndProc_wrapper16(hWnd, uMsg, wParam, lParam, FALSE);
return wow_handlers.static_proc(hWnd, uMsg, wParam, lParam, FALSE);
}
/***********************************************************************
@ -638,7 +619,7 @@ static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
if (!IsWindow( hWnd )) return 0;
return StaticWndProc_wrapper16(hWnd, uMsg, wParam, lParam, TRUE);
return wow_handlers.static_proc(hWnd, uMsg, wParam, lParam, TRUE);
}
static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )

View File

@ -2393,6 +2393,7 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo
orig->edit_proc = EditWndProc_common;
orig->listbox_proc = ListBoxWndProc_common;
orig->scrollbar_proc = ScrollBarWndProc_common;
orig->static_proc = StaticWndProc_common;
wow_handlers = *new;
}
@ -2404,4 +2405,5 @@ struct wow_handlers16 wow_handlers =
EditWndProc_common,
ListBoxWndProc_common,
ScrollBarWndProc_common,
StaticWndProc_common,
};