Ejemplo n.º 1
0
		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;
		}
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        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;
        }