Example #1
0
        private MouseEventArgs DecodeLowLevelMouse(IntPtr lParam)
        {
            MSLLHOOKSTRUCT msllhookstruct = (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT));
            int            time           = msllhookstruct.time;
            int            timeStamp      = this.timeStamp;

            this.timeStamp = msllhookstruct.time;
            MouseEventArgs args = new MouseEventArgs();

            args.x = msllhookstruct.pt.X;
            args.y = msllhookstruct.pt.Y;
            return(args);
        }
        private MouseEventArgs DecodeLowLevelMouse(IntPtr lParam)
        {
            MSLLHOOKSTRUCT input = (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT));

            if (timeStamp == input.time)
            {
                //Console.WriteLine("Time stamp match: " + timeStamp.ToString());
                //return null;
            }
            timeStamp = input.time;
            MouseEventArgs args = new MouseEventArgs();

            args.x = input.pt.X;
            args.y = input.pt.Y;

            return(args);
        }