Alexandre Julliard : user32: Add an ASCII window procedure for scrollbars.

Alexandre Julliard julliard at winehq.org
Wed May 21 05:22:46 CDT 2008


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May 21 11:44:05 2008 +0200

user32: Add an ASCII window procedure for scrollbars.

---

 dlls/user32/scroll.c      |   32 +++++++++++++++++++++++++++-----
 dlls/user32/tests/class.c |    3 ++-
 dlls/user32/winproc.c     |    2 +-
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/dlls/user32/scroll.c b/dlls/user32/scroll.c
index 6f52754..ddfacd6 100644
--- a/dlls/user32/scroll.c
+++ b/dlls/user32/scroll.c
@@ -108,7 +108,8 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
 				    INT thumbSize, INT thumbPos,
 				    UINT flags, BOOL vertical,
 				    BOOL top_selected, BOOL bottom_selected );
-static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
 
 /*********************************************************************
@@ -119,8 +120,8 @@ const struct builtin_class_descr SCROLL_builtin_class =
 {
     scrollbarW,             /* name */
     CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style  */
-    NULL,                   /* procA (winproc is Unicode only) */
-    ScrollBarWndProc,       /* procW */
+    ScrollBarWndProcA,      /* procA */
+    ScrollBarWndProcW,      /* procW */
     sizeof(SCROLLBAR_INFO), /* extra */
     IDC_ARROW,              /* cursor */
     0                       /* brush */
@@ -1371,7 +1372,7 @@ static BOOL SCROLL_SetScrollRange(HWND hwnd, INT nBar, INT minVal, INT maxVal)
 /***********************************************************************
  *           ScrollBarWndProc
  */
-static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+static LRESULT ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode )
 {
     if (!IsWindow( hwnd )) return 0;
 
@@ -1550,12 +1551,33 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
         if (message >= WM_USER)
             WARN("unknown msg %04x wp=%04lx lp=%08lx\n",
 			 message, wParam, lParam );
-        return DefWindowProcW( hwnd, message, wParam, lParam );
+        if (unicode)
+            return DefWindowProcW( hwnd, message, wParam, lParam );
+        else
+            return DefWindowProcA( hwnd, message, wParam, lParam );
     }
     return 0;
 }
 
 
+/***********************************************************************
+ *           ScrollBarWndProcA
+ */
+static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
+    return ScrollBarWndProc( hwnd, message, wParam, lParam, FALSE );
+}
+
+
+/***********************************************************************
+ *           ScrollBarWndProcW
+ */
+static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
+    return ScrollBarWndProc( hwnd, message, wParam, lParam, TRUE );
+}
+
+
 /*************************************************************************
  *           SetScrollInfo   (USER32.@)
  *
diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c
index 486e227..8412e8b 100644
--- a/dlls/user32/tests/class.c
+++ b/dlls/user32/tests/class.c
@@ -570,13 +570,14 @@ static void test_instances(void)
 
 static void test_builtinproc(void)
 {
-    /* Edit behaves differently. ScrollBar have currently only a Unicode winproc */
+    /* Edit behaves differently */
     static const CHAR NORMAL_CLASSES[][10] = {
         "Button",
         "Static",
         "ComboBox",
         "ComboLBox",
         "ListBox",
+        "ScrollBar",
         "#32770",  /* dialog */
     };
     static const int NUM_NORMAL_CLASSES = (sizeof(NORMAL_CLASSES)/sizeof(NORMAL_CLASSES[0]));
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index 6c85d91..6de86e8 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -52,7 +52,7 @@ typedef struct tagWINDOWPROC
 
 #define WINPROC_HANDLE (~0UL >> 16)
 #define MAX_WINPROCS  8192
-#define BUILTIN_WINPROCS 8  /* first BUILTIN_WINPROCS entries are reserved for builtin procs */
+#define BUILTIN_WINPROCS 9  /* first BUILTIN_WINPROCS entries are reserved for builtin procs */
 
 WNDPROC EDIT_winproc_handle = 0;
 




More information about the wine-cvs mailing list