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); }
public static POINT MakePoint(IntPtr lParam) { MOUSEHOOKSTRUCT mousehookstruct = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MOUSEHOOKSTRUCT)); return(mousehookstruct.pt); }