Alexandre Julliard : user32: Split the handling of the 16-bit messages out of the static winproc.

Alexandre Julliard julliard at winehq.org
Mon Dec 14 09:51:10 CST 2009


Module: wine
Branch: master
Commit: fb2022647562d96de4f57bf1174f4610c2643711
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fb2022647562d96de4f57bf1174f4610c2643711

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec 11 20:25:32 2009 +0100

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

---

 dlls/user32/static.c |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/dlls/user32/static.c b/dlls/user32/static.c
index 6c61db2..80c502d 100644
--- a/dlls/user32/static.c
+++ b/dlls/user32/static.c
@@ -572,9 +572,6 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
     case STM_GETIMAGE:
         return (LRESULT)STATIC_GetImage( hwnd, wParam, full_style );
 
-    case STM_GETICON16:
-        return HICON_16(STATIC_GetImage( hwnd, IMAGE_ICON, full_style ));
-
     case STM_GETICON:
         return (LRESULT)STATIC_GetImage( hwnd, IMAGE_ICON, full_style );
 
@@ -597,9 +594,6 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
         STATIC_TryPaintFcn( hwnd, full_style );
 	break;
 
-    case STM_SETICON16:
-        wParam = (WPARAM)HICON_32( (HICON16)wParam );
-        /* fall through */
     case STM_SETICON:
         lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)wParam, full_style );
         STATIC_TryPaintFcn( hwnd, full_style );
@@ -613,12 +607,29 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
 }
 
 /***********************************************************************
+ *           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_common(hWnd, uMsg, wParam, lParam, FALSE);
+    return StaticWndProc_wrapper16(hWnd, uMsg, wParam, lParam, FALSE);
 }
 
 /***********************************************************************
@@ -627,7 +638,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_common(hWnd, uMsg, wParam, lParam, TRUE);
+    return StaticWndProc_wrapper16(hWnd, uMsg, wParam, lParam, TRUE);
 }
 
 static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )




More information about the wine-cvs mailing list