在vb中,用什么样的代码可以使鼠标锁定在一个地方保持20秒

来源:百度知道 编辑:UC知道 时间:2024/05/29 07:43:48
可以再详细一点吗?谢谢啊!急急!

Google搜索“vb 锁定鼠标”

Private Declare Function ClipCursor& Lib "user32" (lpRect As RECT)

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

sub a()
dim a as rect
a.left= 100
a.top=400
a.right=1
a.bottom=1
ClipCursor a
end sub

Private Declare Function ClipCursor& Lib "user32" (lpRect As RECT)

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

将那个Rect设为一个点就行了