Module: wine Branch: master Commit: 80a09a7899e6e91981c9fc8bdbc9fafbb8284437 URL: http://source.winehq.org/git/wine.git/?a=commit;h=80a09a7899e6e91981c9fc8bdb...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Dec 17 13:00:04 2009 +0100
user32: Pre-allocate the window procedure for the static class.
---
dlls/user32/controls.h | 1 + dlls/user32/static.c | 26 ++++---------------------- dlls/user32/winproc.c | 13 +++++++++++++ 3 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 274e59f..72a65a0 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -38,6 +38,7 @@ enum builtin_winprocs WINPROC_EDIT, WINPROC_LISTBOX, WINPROC_SCROLLBAR, + WINPROC_STATIC, NB_BUILTIN_WINPROCS };
diff --git a/dlls/user32/static.c b/dlls/user32/static.c index b33033a..0f778bb 100644 --- a/dlls/user32/static.c +++ b/dlls/user32/static.c @@ -60,8 +60,6 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintBitmapfn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintEnhMetafn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style ); -static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); -static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
static COLORREF color_3dshadow, color_3ddkshadow, color_3dhighlight;
@@ -104,8 +102,8 @@ const struct builtin_class_descr STATIC_builtin_class = { staticW, /* name */ CS_DBLCLKS | CS_PARENTDC, /* style */ - StaticWndProcA, /* procA */ - StaticWndProcW, /* procW */ + NULL, /* procA */ + BUILTIN_WINPROC(WINPROC_STATIC), /* procW */ STATIC_EXTRA_BYTES, /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ @@ -405,6 +403,8 @@ LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam LONG full_style = GetWindowLongW( hwnd, GWL_STYLE ); LONG style = full_style & SS_TYPEMASK;
+ if (!IsWindow( hwnd )) return 0; + switch (uMsg) { case WM_CREATE: @@ -604,24 +604,6 @@ LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam return lResult; }
-/*********************************************************************** - * StaticWndProcA - */ -static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) -{ - if (!IsWindow( hWnd )) return 0; - return wow_handlers.static_proc(hWnd, uMsg, wParam, lParam, FALSE); -} - -/*********************************************************************** - * StaticWndProcW - */ -static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) -{ - if (!IsWindow( hWnd )) return 0; - return wow_handlers.static_proc(hWnd, uMsg, wParam, lParam, TRUE); -} - static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style ) { DRAWITEMSTRUCT dis; diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index c9ed557..d2e75a1 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -59,6 +59,8 @@ static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARA static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); +static LRESULT WINAPI StaticWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); +static LRESULT WINAPI StaticWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
static WINDOWPROC winproc_array[MAX_WINPROCS] = { @@ -67,6 +69,7 @@ static WINDOWPROC winproc_array[MAX_WINPROCS] = { EditWndProcA, EditWndProcW }, /* WINPROC_EDIT */ { ListBoxWndProcA, ListBoxWndProcW }, /* WINPROC_LISTBOX */ { ScrollBarWndProcA, ScrollBarWndProcW }, /* WINPROC_SCROLLBAR */ + { StaticWndProcA, StaticWndProcW }, /* WINPROC_STATIC */ };
static UINT builtin_used = NB_BUILTIN_WINPROCS; @@ -1102,6 +1105,16 @@ static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPA return wow_handlers.scrollbar_proc( hwnd, msg, wParam, lParam, TRUE ); }
+static LRESULT WINAPI StaticWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + return wow_handlers.static_proc( hwnd, msg, wParam, lParam, FALSE ); +} + +static LRESULT WINAPI StaticWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + return wow_handlers.static_proc( hwnd, msg, wParam, lParam, TRUE ); +} +
/********************************************************************** * UserRegisterWowHandlers (USER32.@)