请教一个关于鼠标的问题

来源:百度知道 编辑:UC知道 时间:2024/06/06 11:36:51
谁给推荐个软件~~
就是能控制鼠标 只能让鼠标在一定区域内活动的软件

谁知道啊 有没有这种软件啊 谁给推荐一个~
好用的话有加分啊~~

操作步骤
1、建立一个新工程项目,缺省建立窗体FORM1
2、添加一个新模体
3、粘贴下面代码到新模体

Option ExplicitDeclare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Declare Function ClipCursorClear Lib "user32" Alias "ClipCursor" (ByVal lpRect As Long) As Long
Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Type POINTAPI
X As Long
Y As Long
End Type
Public RetValue As Long
Public ClipMode As Boolean

Public Sub SetCursor(ClipObject As Object, Setting As Boolean)
' used to clip the cursor into the viewport and
' turn off the default windows cursor
Dim CurrentPoint As POINTAPI
Dim ClipRect As RECT
If Setting = False Then
' set clip state back to normal
RetValue = ClipCursorClear(0)
Exit Sub
End If