The WH_MOUSE_LL hook enables you to monitor mouse input events about to be posted in a thread input queue.
For more information, see the LowLevelMouseProc function.