Exemplo n.º 1
0
 public static object MoveCursor(params object[] ps)
 {
     try
     {
         int endX  = (int)ps[0];
         int endY  = (int)ps[1];
         int delay = (int)ps[2];
         while (true)
         {
             var pos = Cursor.Position;
             if (pos.X != endX)
             {
                 pos.X += pos.X < endX ? 1 : -1;
             }
             if (pos.Y != endY)
             {
                 pos.Y += pos.Y < endY ? 1 : -1;
             }
             Meths.SetCursorPos(pos.X, pos.Y);
             if (pos.X == endX && pos.Y == endY)
             {
                 break;
             }
             Thread.Sleep(delay);
         }
     }
     catch (Exception e) { MessageBox.Show(e.ToString()); return(ps); }
     return(ps);
 }
Exemplo n.º 2
0
 public static object SetCursorPos(params object[] ps)
 {
     try
     {
         Meths.SetCursorPos((int)ps[0], (int)ps[1]);
     }
     catch (Exception e) { MessageBox.Show(e.ToString()); return(ps); }
     return(ps);
 }