[win32k]
[reactos.git] / reactos / subsystems / win32 / win32k / ntuser / msgqueue.c
index 2567c80..06631be 100644 (file)
@@ -174,9 +174,39 @@ MsqInsertSystemMessage(MSG* Msg)
    LARGE_INTEGER LargeTickCount;
    KIRQL OldIrql;
    ULONG Prev;
+   MSLLHOOKSTRUCT MouseHookData;
 
    KeQueryTickCount(&LargeTickCount);
    Msg->time = MsqCalculateMessageTime(&LargeTickCount);
+
+   MouseHookData.pt.x = LOWORD(Msg->lParam);
+   MouseHookData.pt.y = HIWORD(Msg->lParam);
+   switch(Msg->message)
+   {
+      case WM_MOUSEWHEEL:
+         MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg->wParam));
+         break;
+      case WM_XBUTTONDOWN:
+      case WM_XBUTTONUP:
+      case WM_XBUTTONDBLCLK:
+      case WM_NCXBUTTONDOWN:
+      case WM_NCXBUTTONUP:
+      case WM_NCXBUTTONDBLCLK:
+         MouseHookData.mouseData = MAKELONG(0, HIWORD(Msg->wParam));
+         break;
+      default:
+         MouseHookData.mouseData = 0;
+         break;
+   }
+
+   MouseHookData.flags = 0;
+   MouseHookData.time = Msg->time;
+   MouseHookData.dwExtraInfo = 0;
+
+   /* If the hook procedure returned non zero, dont send the message */
+   if (co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, Msg->message, (LPARAM) &MouseHookData))
+      return;
+
    /*
     * If we got WM_MOUSEMOVE and there are already messages in the
     * system message queue, check if the last message is mouse move