Dylan Smith : richedit: Compare editor rather than hWnd in ME_CalculateClickCount.

Alexandre Julliard julliard at winehq.org
Mon Dec 15 08:27:29 CST 2008


Module: wine
Branch: master
Commit: 0c8e4b6d02b0cd9faf835f7eaa4efacfe547e585
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0c8e4b6d02b0cd9faf835f7eaa4efacfe547e585

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Mon Dec 15 04:32:01 2008 -0500

richedit: Compare editor rather than hWnd in ME_CalculateClickCount.

Comparing the editor as apposed to the handle to the window will work
just as well right now, but will also work when there is no window
handle to make a comparison with, which will be the case with
windowless richedit controls.

---

 dlls/riched20/editor.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 49f5740..0d3010a 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2182,7 +2182,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
 /* Process the message and calculate the new click count.
  *
  * returns: The click count if it is mouse down event, else returns 0. */
-static int ME_CalculateClickCount(HWND hWnd, UINT msg, WPARAM wParam,
+static int ME_CalculateClickCount(ME_TextEditor *editor, UINT msg, WPARAM wParam,
                                   LPARAM lParam)
 {
     static int clickNum = 0;
@@ -2204,7 +2204,9 @@ static int ME_CalculateClickCount(HWND hWnd, UINT msg, WPARAM wParam,
     {
         static MSG prevClickMsg;
         MSG clickMsg;
-        clickMsg.hwnd = hWnd;
+        /* Compare the editor instead of the hwnd so that the this
+         * can still be done for windowless richedit controls. */
+        clickMsg.hwnd = (HWND)editor;
         clickMsg.message = msg;
         clickMsg.wParam = wParam;
         clickMsg.lParam = lParam;
@@ -3596,7 +3598,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
       return 0;
     SetFocus(hWnd);
     ME_LButtonDown(editor, (short)LOWORD(lParam), (short)HIWORD(lParam),
-                   ME_CalculateClickCount(hWnd, msg, wParam, lParam));
+                   ME_CalculateClickCount(editor, msg, wParam, lParam));
     SetCapture(hWnd);
     ME_LinkNotify(editor,msg,wParam,lParam);
     if (!ME_SetCursor(editor)) goto do_default;




More information about the wine-cvs mailing list