private static void InjectLeftMouseUp(IntPtr child, NPoint clientLocation) { IntPtr lParamClickLocation = MessagingMethods.MakeLParam(clientLocation.X, clientLocation.Y); MessagingMethods.PostMessage(child, WM.LBUTTONUP, new IntPtr(MK.LBUTTON), lParamClickLocation); #if DEBUG System.Diagnostics.Debug.WriteLine("InjectLeftMouseUpMove #" + child.ToString() + " at " + clientLocation.ToString()); #endif }
private static void InjectLeftMouseClick(IntPtr child, NPoint clientLocation) { IntPtr lParamClickLocation = MessagingMethods.MakeLParam(clientLocation.X, clientLocation.Y); MessagingMethods.PostMessage(child, WM.LBUTTONDOWN, new IntPtr(MK.LBUTTON), lParamClickLocation); MessagingMethods.PostMessage(child, WM.LBUTTONUP, new IntPtr(MK.LBUTTON), lParamClickLocation); //IntPtr lParamClickLocation2 = MessagingMethods.MakeLParam(clientLocation.X+100, clientLocation.Y+100); //MessagingMethods.PostMessage(child, WM.MOUSEMOVE, new IntPtr(MK.LBUTTON), lParamClickLocation2); #if DEBUG System.Diagnostics.Debug.WriteLine("Left click on window #" + child.ToString() + " at " + clientLocation.ToString()); #endif }
private static void InjectDoubleRightMouseClick(IntPtr child, NPoint clientLocation) { IntPtr lParamClickLocation = MessagingMethods.MakeLParam(clientLocation.X, clientLocation.Y); MessagingMethods.PostMessage(child, WM.RBUTTONDBLCLK, new IntPtr(MK.RBUTTON), lParamClickLocation); #if DEBUG System.Diagnostics.Debug.WriteLine("Double right click on window #" + child.ToString() + " at " + clientLocation.ToString()); #endif }