Huw Davies : riched20: Use EM_GETTEXTEX to implement WM_GETTEXT.

Alexandre Julliard julliard at winehq.org
Fri Mar 12 14:36:15 CST 2021


Module: wine
Branch: master
Commit: 6a173becd46d9930ffbc1f25cc3f9d2cdce403ca
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6a173becd46d9930ffbc1f25cc3f9d2cdce403ca

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Mar 12 09:01:35 2021 +0000

riched20: Use EM_GETTEXTEX to implement WM_GETTEXT.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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)&params, lparam, &res );
+        break;
+    }
     case WM_GETTEXTLENGTH:
     {
         GETTEXTLENGTHEX params;




More information about the wine-cvs mailing list