[PATCH] user32: Add MOUSEHOOKSTRUCTEX for mouse wheel support.

Alex Henrie alexhenrie24 at gmail.com
Thu Feb 4 00:58:17 CST 2016


From: Kira Backes <kira.backes at nrwsoft.de>

Fixes https://bugs.winehq.org/show_bug.cgi?id=38314

From: Kira Backes <kira.backes at nrwsoft.de>
Signed-off-by: Kira Backes <kira.backes at nrwsoft.de>
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/user32/message.c | 22 +++++++++++++---------
 include/winuser.h     | 11 +++++++++++
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index ba3f4c6..f6dcefa 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2489,7 +2489,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
     INT hittest;
     EVENTMSG event;
     GUITHREADINFO info;
-    MOUSEHOOKSTRUCT hook;
+    MOUSEHOOKSTRUCTEX hook;
     BOOL eatMsg;
 
     /* find the window to dispatch this mouse message to */
@@ -2585,17 +2585,21 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
 
     /* message is accepted now (but may still get dropped) */
 
-    hook.pt           = msg->pt;
-    hook.hwnd         = msg->hwnd;
-    hook.wHitTestCode = hittest;
-    hook.dwExtraInfo  = extra_info;
+    hook.s.pt           = msg->pt;
+    hook.s.hwnd         = msg->hwnd;
+    hook.s.wHitTestCode = hittest;
+    hook.s.dwExtraInfo  = extra_info;
+    /* the correct mouseData for the events WM_XBUTTONDOWN, WM_XBUTTONUP, WM_XBUTTONDBLCLK,
+     * WM_NCXBUTTONDOWN, WM_NCXBUTTONUP, and WM_NCXBUTTONDBLCLK is not yet implemented */
+    hook.mouseData      = (msg->message == WM_MOUSEWHEEL ? msg->wParam : 0);
     if (HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
                         message, (LPARAM)&hook, TRUE ))
     {
-        hook.pt           = msg->pt;
-        hook.hwnd         = msg->hwnd;
-        hook.wHitTestCode = hittest;
-        hook.dwExtraInfo  = extra_info;
+        hook.s.pt           = msg->pt;
+        hook.s.hwnd         = msg->hwnd;
+        hook.s.wHitTestCode = hittest;
+        hook.s.dwExtraInfo  = extra_info;
+        hook.mouseData      = (msg->message == WM_MOUSEWHEEL ? msg->wParam : 0);
         HOOK_CallHooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, TRUE );
         accept_hardware_message( hw_id, TRUE );
         return FALSE;
diff --git a/include/winuser.h b/include/winuser.h
index 74d3cd5..b5f89c1 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -385,6 +385,17 @@ typedef struct
     ULONG_PTR dwExtraInfo;
 } MOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT, *LPMOUSEHOOKSTRUCT;
 
+typedef struct
+{
+    struct { /* MOUSEHOOKSTRUCT */
+        POINT pt;
+        HWND  hwnd;
+        UINT  wHitTestCode;
+        ULONG_PTR dwExtraInfo;
+    } DUMMYSTRUCTNAME;
+    DWORD mouseData;
+} MOUSEHOOKSTRUCTEX, *PMOUSEHOOKSTRUCTEX, *LPMOUSEHOOKSTRUCTEX;
+
 
     /* Hardware hook structure */
 
-- 
2.7.0




More information about the wine-patches mailing list