Commit 79b64fdc authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Add an ASCII window procedure for scrollbars.

parent 248cc53d
...@@ -108,7 +108,8 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar, ...@@ -108,7 +108,8 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
INT thumbSize, INT thumbPos, INT thumbSize, INT thumbPos,
UINT flags, BOOL vertical, UINT flags, BOOL vertical,
BOOL top_selected, BOOL bottom_selected ); 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 = ...@@ -119,8 +120,8 @@ const struct builtin_class_descr SCROLL_builtin_class =
{ {
scrollbarW, /* name */ scrollbarW, /* name */
CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */ CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */
NULL, /* procA (winproc is Unicode only) */ ScrollBarWndProcA, /* procA */
ScrollBarWndProc, /* procW */ ScrollBarWndProcW, /* procW */
sizeof(SCROLLBAR_INFO), /* extra */ sizeof(SCROLLBAR_INFO), /* extra */
IDC_ARROW, /* cursor */ IDC_ARROW, /* cursor */
0 /* brush */ 0 /* brush */
...@@ -1371,7 +1372,7 @@ static BOOL SCROLL_SetScrollRange(HWND hwnd, INT nBar, INT minVal, INT maxVal) ...@@ -1371,7 +1372,7 @@ static BOOL SCROLL_SetScrollRange(HWND hwnd, INT nBar, INT minVal, INT maxVal)
/*********************************************************************** /***********************************************************************
* ScrollBarWndProc * 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; if (!IsWindow( hwnd )) return 0;
...@@ -1550,12 +1551,33 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, ...@@ -1550,12 +1551,33 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
if (message >= WM_USER) if (message >= WM_USER)
WARN("unknown msg %04x wp=%04lx lp=%08lx\n", WARN("unknown msg %04x wp=%04lx lp=%08lx\n",
message, wParam, lParam ); 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; 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.@) * SetScrollInfo (USER32.@)
* *
......
...@@ -570,13 +570,14 @@ static void test_instances(void) ...@@ -570,13 +570,14 @@ static void test_instances(void)
static void test_builtinproc(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] = { static const CHAR NORMAL_CLASSES[][10] = {
"Button", "Button",
"Static", "Static",
"ComboBox", "ComboBox",
"ComboLBox", "ComboLBox",
"ListBox", "ListBox",
"ScrollBar",
"#32770", /* dialog */ "#32770", /* dialog */
}; };
static const int NUM_NORMAL_CLASSES = (sizeof(NORMAL_CLASSES)/sizeof(NORMAL_CLASSES[0])); static const int NUM_NORMAL_CLASSES = (sizeof(NORMAL_CLASSES)/sizeof(NORMAL_CLASSES[0]));
......
...@@ -52,7 +52,7 @@ typedef struct tagWINDOWPROC ...@@ -52,7 +52,7 @@ typedef struct tagWINDOWPROC
#define WINPROC_HANDLE (~0UL >> 16) #define WINPROC_HANDLE (~0UL >> 16)
#define MAX_WINPROCS 8192 #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; WNDPROC EDIT_winproc_handle = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment