riched20: Use EM_GETTEXTEX to implement WM_GETTEXT.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2021-03-12 09:01:35 +00:00 committed by Alexandre Julliard
parent 859b1e8962
commit 6a173becd4
2 changed files with 14 additions and 2 deletions

View File

@ -3978,9 +3978,9 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
case WM_GETTEXT:
{
GETTEXTEX ex;
ex.cb = wParam * (unicode ? sizeof(WCHAR) : sizeof(CHAR));
ex.cb = wParam * sizeof(WCHAR);
ex.flags = GT_USECRLF;
ex.codepage = unicode ? CP_UNICODE : CP_ACP;
ex.codepage = CP_UNICODE;
ex.lpDefaultChar = NULL;
ex.lpUsedDefChar = NULL;
return ME_GetTextEx(editor, &ex, lParam);

View File

@ -801,6 +801,18 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
FillRect( hdc, &rc, editor->hbrBackground );
return 1;
}
case WM_GETTEXT:
{
GETTEXTEX params;
params.cb = wparam * (unicode ? sizeof(WCHAR) : sizeof(CHAR));
params.flags = GT_USECRLF;
params.codepage = unicode ? CP_UNICODE : CP_ACP;
params.lpDefaultChar = NULL;
params.lpUsedDefChar = NULL;
hr = ITextServices_TxSendMessage( host->text_srv, EM_GETTEXTEX, (WPARAM)&params, lparam, &res );
break;
}
case WM_GETTEXTLENGTH:
{
GETTEXTLENGTHEX params;