示例#1
0
        private MouseEventArgs DecodeMouseMove(IntPtr lParam)
        {
            MOUSEHOOKSTRUCT mousehookstruct = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MOUSEHOOKSTRUCT));
            MouseEventArgs  args            = new MouseEventArgs();

            args.x           = mousehookstruct.pt.X;
            args.y           = mousehookstruct.pt.Y;
            args.hitTestCode = mousehookstruct.wHitTestCode;
            return(args);
        }
示例#2
0
        public static POINT MakePoint(IntPtr lParam)
        {
            MOUSEHOOKSTRUCT mousehookstruct = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MOUSEHOOKSTRUCT));

            return(mousehookstruct.pt);
        }