程序中如何移动鼠标

发表于:2007-06-21来源:作者:点击数: 标签:
How can I move the mouse cursor? You can use the SetCursorPos Api function. It accepts two parameters. These are the x position and the y position in screen pixel coordinates. You can get the size of the screen by calling GetSystemMetrics

   
  How can I move the mouse cursor?

You can use the SetCursorPos Api function. It aclearcase/" target="_blank" >ccepts two parameters. These are the x position and the y position in screen pixel coordinates. You can get the size of the screen by calling GetSystemMetrics function with the correct constants. This example puts the mouse cursor in the top left hand corner.

t& = SetCursorPos(0,0)This will only work if the formula has bee declared in the declarations section:

Declare Function SetCursorPosition& Lib "user32" _
(ByVal x As Long, ByVal y As Long)

原文转自:http://www.ltesting.net