鼠标模拟拖放

时间:2014-07-25 15:35:20

标签: c# drag-and-drop mousemove

我试图用鼠标模拟拖放。 目前鼠标移动到正确的位置,它甚至点击文件,但是当它转到下一点时似乎没有拖动文件?

这就是我所拥有的:

   MouseOperations.SetCursorPosition(myPoints[0].X, myPoints[0].Y);
            MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftDown);


            Thread.Sleep(2000);

            MouseOperations.SetCursorPosition(myPoints[1].X, myPoints[1].Y);

            Thread.Sleep(2000);

            MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftUp);

mouseOperations类在这里:

http://pastebin.com/KtjTJi4b

0 个答案:

没有答案