VB写锁定鼠标移动

来源:百度知道 编辑:UC知道 时间:2024/06/18 03:13:59
VB写个锁定鼠标移动的
也就是 鼠标 在 桌面正中央 可以平移可以点击鼠标左键
不能上下移动。
谁能给下上面所说的代码啊。。谢谢了~

api函数clipcursor
作用是把鼠标限制到指定区域
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
dim CurRect as rect
with CurRect
.left=0
.top=screen.height\2
.right=screen.width
.bottom=screen.height\2
end with
clipcursor CurRect
取消限制用Declare Function ClipCursorBynum& Lib "user32" Alias "ClipCursor" (ByVal lpRect As Long)