Esempio n. 1
0
 static int MouseHookProc(int nCode, int wParam, IntPtr lParam)
 {
     if (nCode >= 0)
     {
         //把参数lParam在内存中指向的数据转换为MOUSEHOOKSTRUCT结构
         MOUSEHOOKSTRUCT mouse = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MOUSEHOOKSTRUCT));//鼠标
         //这句为了看鼠标的位置
         if (wParam == Hooker.WM_RBUTTONDOWN || wParam == Hooker.WM_RBUTTONUP)
         { //鼠标按下或者释放时候截获
             handle.Mouse_RightButtonDown(mouse.pt);
         }
     }
     return(Hooker.CallNextHookEx(Hooker.hMouseHook, nCode, wParam, lParam));
 }
        bool PickObjectsMouseHook_RightButtonUp(System.Drawing.Point pt)
        {
            this.UninstallHook();

            if (this.mode == OKModeENUM.Objects)
            {
                handle = new ButtonHandle();
                handle.Mouse_RightButtonDown(pt);
            }
            else
            {
                Common.RevitClass.Keyboard.RevitKeyboardCommand.PostEscCommand();
            }

            return(true);
        }