public static void Drag(int x1, int y1, int x2, int y2) { Point newPos1 = Convert(new Point(x1, y1)); Point newPos2 = Convert(new Point(x2, y2)); AutoItX.MouseClickDrag("LEFT", newPos1.X, newPos1.Y, newPos2.X, newPos2.Y); }
private void SearchAndSelectComboBox(IntPtr mainWindow, IntPtr searchComboBox, string value) { Rectangle mainWindowPosition = AutoItX.WinGetPos(mainWindow); Rectangle refElementPosition = AutoItX.ControlGetPos(mainWindow, searchComboBox); int startX = mainWindowPosition.X + refElementPosition.X; int startY = mainWindowPosition.Y + refElementPosition.Y; int elementPossitionX = startX + 10; int elementPossitionY = startY + 10; AutoItX.MouseMove(elementPossitionX, elementPossitionY); AutoItX.MouseClickDrag("LEFT", elementPossitionX, elementPossitionY, elementPossitionX + 100, elementPossitionY + 30, 100); AutoItX.MouseDown(); AutoItX.MouseUp(); AutoItX.ClipPut(value); AutoItX.Send("^v"); AutoItX.MouseMove(elementPossitionX + 100, elementPossitionY + 70); AutoItX.MouseDown(); AutoItX.MouseUp(); Thread.Sleep(GetRandomDelay(100)); // stop to make sure the dropdown selected done }
public void DrawLine(int xStartCoordinate, int yStartCoordinate, int xEndCoordinate, int yEndCoordinate) { AutoItX.MouseClickDrag("LEFT", xCoordinateRefactor(xStartCoordinate), yCoordianteRefactor(yStartCoordinate), xCoordinateRefactor(xEndCoordinate), yCoordianteRefactor(yEndCoordinate)); }
public int MouseClickDrag(string button, int x1, int y1, int x2, int y2, int speed = -1) { return(AutoItX.MouseClickDrag(button, x1, y1, x2, y2, speed)); }
static public void dragMouseRight(int fromX, int fromY, int toX, int toY, int speed = 0) { AutoItX.MouseClickDrag("RIGHT", fromX, fromY, toX, toY, speed); }