Esempio n. 1
0
        /// <summary>
        /// Processes mouse event captured
        /// </summary>
        private int lowLevelMouseHookCallback(int nCode, WinApi.MouseMessages wParam, ref WinApi.MSLLHOOKSTRUCT lParam)
        {
            // if being suppressed, return a dummy value < 0
            int  retValue = -1;
            bool handled  = false;

            if (nCode >= 0)
            {
                MouseHookEventArgs eventArgs = new MouseHookEventArgs(wParam, lParam);

                OnMouseKeyHook(eventArgs);

                handled = eventArgs.Handled;
            }

            if (!handled)
            {
                // Pass msg to the next registered application
                retValue = WinApi.CallNextHookEx(IntPtr.Zero, nCode, wParam, lParam);
            }

            return(retValue);
        }
Esempio n. 2
0
 public MouseHookEventArgs(WinApi.MouseMessages wParam, WinApi.MSLLHOOKSTRUCT lParam)
 {
     m_wParam = wParam;
     m_lParam = lParam;
 }