user32: Pre-allocate the window procedure for the button class.
This commit is contained in:
parent
b71173f7ac
commit
87f83f8618
|
@ -113,8 +113,6 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action );
|
||||||
static void UB_Paint( HWND hwnd, HDC hDC, UINT action );
|
static void UB_Paint( HWND hwnd, HDC hDC, UINT action );
|
||||||
static void OB_Paint( HWND hwnd, HDC hDC, UINT action );
|
static void OB_Paint( HWND hwnd, HDC hDC, UINT action );
|
||||||
static void BUTTON_CheckAutoRadioButton( HWND hwnd );
|
static void BUTTON_CheckAutoRadioButton( HWND hwnd );
|
||||||
static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
|
||||||
static LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
|
||||||
|
|
||||||
#define MAX_BTN_TYPE 12
|
#define MAX_BTN_TYPE 12
|
||||||
|
|
||||||
|
@ -164,8 +162,8 @@ const struct builtin_class_descr BUTTON_builtin_class =
|
||||||
{
|
{
|
||||||
buttonW, /* name */
|
buttonW, /* name */
|
||||||
CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */
|
CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */
|
||||||
ButtonWndProcA, /* procA */
|
NULL, /* procA */
|
||||||
ButtonWndProcW, /* procW */
|
BUILTIN_WINPROC(WINPROC_BUTTON), /* procW */
|
||||||
NB_EXTRA_BYTES, /* extra */
|
NB_EXTRA_BYTES, /* extra */
|
||||||
IDC_ARROW, /* cursor */
|
IDC_ARROW, /* cursor */
|
||||||
0 /* brush */
|
0 /* brush */
|
||||||
|
@ -238,6 +236,8 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||||
LONG state;
|
LONG state;
|
||||||
HANDLE oldHbitmap;
|
HANDLE oldHbitmap;
|
||||||
|
|
||||||
|
if (!IsWindow( hWnd )) return 0;
|
||||||
|
|
||||||
pt.x = (short)LOWORD(lParam);
|
pt.x = (short)LOWORD(lParam);
|
||||||
pt.y = (short)HIWORD(lParam);
|
pt.y = (short)HIWORD(lParam);
|
||||||
|
|
||||||
|
@ -545,26 +545,6 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* ButtonWndProcW
|
|
||||||
*/
|
|
||||||
static LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
|
||||||
{
|
|
||||||
if (!IsWindow( hWnd )) return 0;
|
|
||||||
return wow_handlers.button_proc( hWnd, uMsg, wParam, lParam, TRUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* ButtonWndProcA
|
|
||||||
*/
|
|
||||||
static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
|
||||||
{
|
|
||||||
if (!IsWindow( hWnd )) return 0;
|
|
||||||
return wow_handlers.button_proc( hWnd, uMsg, wParam, lParam, FALSE );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Convert button styles to flags used by DrawText.
|
* Convert button styles to flags used by DrawText.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -31,6 +31,15 @@
|
||||||
#define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
|
#define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
|
||||||
#define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
|
#define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
|
||||||
|
|
||||||
|
enum builtin_winprocs
|
||||||
|
{
|
||||||
|
WINPROC_BUTTON = 0,
|
||||||
|
NB_BUILTIN_WINPROCS
|
||||||
|
};
|
||||||
|
|
||||||
|
#define WINPROC_HANDLE (~0u >> 16)
|
||||||
|
#define BUILTIN_WINPROC(index) ((WNDPROC)(ULONG_PTR)((index) | (WINPROC_HANDLE << 16)))
|
||||||
|
|
||||||
/* Built-in class descriptor */
|
/* Built-in class descriptor */
|
||||||
struct builtin_class_descr
|
struct builtin_class_descr
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,6 @@ typedef struct tagWINDOWPROC
|
||||||
WNDPROC procW; /* Unicode window proc */
|
WNDPROC procW; /* Unicode window proc */
|
||||||
} WINDOWPROC;
|
} WINDOWPROC;
|
||||||
|
|
||||||
#define WINPROC_HANDLE (~0u >> 16)
|
|
||||||
#define MAX_WINPROCS 4096
|
#define MAX_WINPROCS 4096
|
||||||
#define BUILTIN_WINPROCS 9 /* first BUILTIN_WINPROCS entries are reserved for builtin procs */
|
#define BUILTIN_WINPROCS 9 /* first BUILTIN_WINPROCS entries are reserved for builtin procs */
|
||||||
#define MAX_WINPROC_RECURSION 64
|
#define MAX_WINPROC_RECURSION 64
|
||||||
|
@ -52,8 +51,15 @@ typedef struct tagWINDOWPROC
|
||||||
|
|
||||||
WNDPROC EDIT_winproc_handle = 0;
|
WNDPROC EDIT_winproc_handle = 0;
|
||||||
|
|
||||||
static WINDOWPROC winproc_array[MAX_WINPROCS];
|
static LRESULT WINAPI ButtonWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||||
static UINT builtin_used;
|
static LRESULT WINAPI ButtonWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||||
|
|
||||||
|
static WINDOWPROC winproc_array[MAX_WINPROCS] =
|
||||||
|
{
|
||||||
|
{ ButtonWndProcA, ButtonWndProcW }, /* WINPROC_BUTTON */
|
||||||
|
};
|
||||||
|
|
||||||
|
static UINT builtin_used = NB_BUILTIN_WINPROCS;
|
||||||
static UINT winproc_used = BUILTIN_WINPROCS;
|
static UINT winproc_used = BUILTIN_WINPROCS;
|
||||||
|
|
||||||
static CRITICAL_SECTION winproc_cs;
|
static CRITICAL_SECTION winproc_cs;
|
||||||
|
@ -1032,6 +1038,21 @@ INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* Window procedures for builtin classes
|
||||||
|
*/
|
||||||
|
|
||||||
|
static LRESULT WINAPI ButtonWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
return wow_handlers.button_proc( hwnd, msg, wParam, lParam, FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
static LRESULT WINAPI ButtonWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
return wow_handlers.button_proc( hwnd, msg, wParam, lParam, TRUE );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* UserRegisterWowHandlers (USER32.@)
|
* UserRegisterWowHandlers (USER32.@)
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue