internal MouseHookEventArgs(IntPtr wparam, IntPtr lparam) { if (!Enum.IsDefined(typeof(MouseMessages), wparam.ToInt32())) message = MouseMessages.Unknown; else message = (MouseMessages)wparam.ToInt32(); MOUSEHOOKSTRUCT hs = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lparam, typeof(MOUSEHOOKSTRUCT)); point = new Point(hs.pt.x, hs.pt.y); hwnd = hs.hwnd; hitTestCode = (HitTestCodes)hs.hitTestCode; extraInfo = hs.extraInfo; }
internal MouseHookEventArgs(System.IntPtr wparam, System.IntPtr lparam) { if (!System.Enum.IsDefined(typeof(MouseMessages), (int) wparam.ToInt32())) { this.message = MouseMessages.Unknown; } else { this.message = (MouseMessages) wparam.ToInt32(); } MOUSEHOOKSTRUCT mousehookstruct = (MOUSEHOOKSTRUCT) System.Runtime.InteropServices.Marshal.PtrToStructure(lparam, typeof(MOUSEHOOKSTRUCT)); this.point = new System.Drawing.Point(mousehookstruct.pt.x, mousehookstruct.pt.y); this.hwnd = mousehookstruct.hwnd; this.hitTestCode = (HitTestCodes) mousehookstruct.hitTestCode; this.extraInfo = mousehookstruct.extraInfo; }
internal MouseHookEventArgs(IntPtr wparam, IntPtr lparam) { if (!Enum.IsDefined(typeof(MouseMessages), wparam.ToInt32())) { message = MouseMessages.Unknown; } else { message = (MouseMessages)wparam.ToInt32(); } MOUSEHOOKSTRUCT hs = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lparam, typeof(MOUSEHOOKSTRUCT)); point = new Point(hs.pt.x, hs.pt.y); hwnd = hs.hwnd; hitTestCode = (HitTestCodes)hs.hitTestCode; extraInfo = hs.extraInfo; }