[PATCH 2/5] riched20: Use EM_GETTEXTEX to implement WM_GETTEXT.
Huw Davies
huw at codeweavers.com
Fri Mar 12 03:01:35 CST 2021
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
dlls/riched20/editor.c | 4 ++--
dlls/riched20/txthost.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 6532f7c65cb..53d54a3b8e2 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -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);
diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c
index e401759991f..ca911453010 100644
--- a/dlls/riched20/txthost.c
+++ b/dlls/riched20/txthost.c
@@ -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)¶ms, lparam, &res );
+ break;
+ }
case WM_GETTEXTLENGTH:
{
GETTEXTLENGTHEX params;
--
2.23.0
More information about the wine-devel
mailing list