From 1da348910eed5834616b8902a6c936bae3f3d2ce Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 14 Feb 2001 21:50:09 +0000 Subject: [PATCH] Fixed WM_GETTEXTLENGTH handling. --- windows/defwnd.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/windows/defwnd.c b/windows/defwnd.c index 992631c79c5..0cbf82e4999 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -493,10 +493,6 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam, case WM_CTLCOLOR: return (LRESULT)DEFWND_ControlColor( (HDC)wParam, HIWORD(lParam) ); - case WM_GETTEXTLENGTH: - if (wndPtr->text) return (LRESULT)strlenW(wndPtr->text); - return 0; - case WM_SETCURSOR: if (wndPtr->dwStyle & WS_CHILD) { @@ -704,6 +700,12 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, } break; + case WM_GETTEXTLENGTH: + if (wndPtr->text) + result = WideCharToMultiByte( CP_ACP, 0, wndPtr->text, strlenW(wndPtr->text), + NULL, 0, NULL, NULL ); + break; + case WM_GETTEXT: if (wParam && wndPtr->text) { @@ -774,6 +776,12 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, } break; + case WM_GETTEXTLENGTH: + if (wndPtr->text) + result = WideCharToMultiByte( CP_ACP, 0, wndPtr->text, strlenW(wndPtr->text), + NULL, 0, NULL, NULL ); + break; + case WM_GETTEXT: if (wParam && wndPtr->text) { @@ -892,6 +900,10 @@ LRESULT WINAPI DefWindowProcW( } break; + case WM_GETTEXTLENGTH: + if (wndPtr->text) result = (LRESULT)strlenW(wndPtr->text); + break; + case WM_GETTEXT: if (wParam && wndPtr->text) {