private int WM_LButtonDblClick_Handler(IntPtr hwnd, uint msg, uint wParam, int lParam, ref bool handled) { base.Capture = true; base.Focus(); this.DrawButton(hwnd, true); this.lastCursorCoordinates = Win32.LParamToPoint(lParam); this.OnDoubleClick(new MouseEventArgs(MouseButtons.Left, 1, this.lastCursorCoordinates.X, this.lastCursorCoordinates.Y, 0)); handled = true; return(0); }
private int WM_MouseMove_Handler(IntPtr hwnd, uint msg, uint wParam, int lParam, ref bool handled) { if (base.Capture) { Point point = Win32.LParamToPoint(lParam); if (this.EventOnMouseMove != null) { this.EventOnMouseMove(this, new MouseEventArgs(MouseButtons.Left, 1, point.X, point.Y, 0)); } } return(-1); }
private int WM_LButtonUp_Handler(IntPtr hwnd, uint msg, uint wParam, int lParam, ref bool handled) { base.Capture = false; this.DrawButton(hwnd, false); this.lastCursorCoordinates = Win32.LParamToPoint(lParam); if (base.ClientRectangle.Contains(this.lastCursorCoordinates)) { this.OnMouseUp(new MouseEventArgs(MouseButtons.Left, 1, this.lastCursorCoordinates.X, this.lastCursorCoordinates.Y, 0)); } handled = true; return(0); }