Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public static POINT MakePoint(IntPtr lParam)
        {
            MOUSEHOOKSTRUCT mousehookstruct = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MOUSEHOOKSTRUCT));

            return(mousehookstruct.pt);
        }