Example #1
0
 protected void OnMouseDoubleClick(MouseHookEventArgs e)
 {
     if (MouseDoubleClick != null)
     {
         MouseDoubleClick(this, e);
     }
 }
Example #2
0
 protected void OnMouseUp(MouseHookEventArgs e)
 {
     if (MouseUp != null)
     {
         MouseUp(this, e);
     }
 }
Example #3
0
 protected void OnMouseMove(MouseHookEventArgs e)
 {
     if (MouseMove != null)
     {
         MouseMove(this, e);
     }
 }
Example #4
0
 protected void OnMouseDown(MouseHookEventArgs e)
 {
     if (MouseDown != null)
     {
         MouseDown(this, e);
     }
 }
Example #5
0
        /// <summary>
        /// Raises the appropriate MouseHook event
        /// </summary>
        /// <param name="wParam">The message ID passed to MouseProc</param>
        /// <param name="args">The repackaged arguments passed to MouseProc</param>
        private void RaiseMouseHookEvent(IntPtr wParam, MouseHookEventArgs args)
        {
            switch (wParam.ToInt32())
            {
            // mousemove messages
            case Win32.WM_MOUSEMOVE:
                OnMouseMove(args);
                break;

            case Win32.WM_NCMOUSEMOVE:
                args.SetNonClient();
                OnMouseMove(args);
                break;

            // button down messages
            case Win32.WM_LBUTTONDOWN:
            case Win32.WM_RBUTTONDOWN:
            case Win32.WM_MBUTTONDOWN:
            case Win32.WM_XBUTTONDOWN:
                OnMouseDown(args);
                break;

            case Win32.WM_NCLBUTTONDOWN:
            case Win32.WM_NCRBUTTONDOWN:
            case Win32.WM_NCMBUTTONDOWN:
            case Win32.WM_NCXBUTTONDOWN:
                args.SetNonClient();
                OnMouseDown(args);
                break;

            // button up messages
            case Win32.WM_LBUTTONUP:
            case Win32.WM_RBUTTONUP:
            case Win32.WM_MBUTTONUP:
            case Win32.WM_XBUTTONUP:
                OnMouseUp(args);
                break;

            case Win32.WM_NCLBUTTONUP:
            case Win32.WM_NCRBUTTONUP:
            case Win32.WM_NCMBUTTONUP:
            case Win32.WM_NCXBUTTONUP:
                args.SetNonClient();
                OnMouseUp(args);
                break;

            // double click messages
            case Win32.WM_LBUTTONDBLCLK:
            case Win32.WM_RBUTTONDBLCLK:
            case Win32.WM_MBUTTONDBLCLK:
            case Win32.WM_XBUTTONDBLCLK:
                OnMouseDoubleClick(args);
                break;

            case Win32.WM_NCLBUTTONDBLCLK:
            case Win32.WM_NCRBUTTONDBLCLK:
            case Win32.WM_NCMBUTTONDBLCLK:
            case Win32.WM_NCXBUTTONDBLCLK:
                args.SetNonClient();
                OnMouseDoubleClick(args);
                break;
            }
        }