Possible Duplicate:
C# moving the mouse around realistically
I am able to move the mouse as:
[DllImport("user32.dll")]
public static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo);
// move relative from where the cursor is
public static void Move(int xDelta, int yDelta)
{
mouse_event(0x0001, xDelta, yDelta, 0, 0);
}
anyways I would like to move the mouse smoothly so that the user can see it. I would like to animate it and take 1 second to move it to the new location. as a result I am looking for a method that will work as:
public static void Move(int xDelta, int yDelta, int timeInMiliseconds)
{
// i will like to move the mouse to
(mouse.getCurentPos().x+xDelta, mouse.getCurentPos().y+yDelta)
// in timeInMiliseconds miliseconds
}