VB该如何将鼠标彻底隐藏掉;
求VB代码,如何让鼠标彻底隐藏掉,使用ShowCursor仅能实现窗体内的鼠标隐藏只要鼠标离开窗体立即就出现(编译完成的.exe),该如何让鼠标离开窗口后依然不显示出来呢...
求 VB代码,如何让鼠标彻底隐藏掉,使用 ShowCursor 仅能实现窗体内的鼠标隐藏 只要鼠标离开窗体立即就出现(编译完成的 .exe),该如何让鼠标离开窗口后依然不显示出来呢??????(也就是隐藏鼠标对其他所有程序的窗口都有效,让鼠标在整个屏幕上彻底看不见;)
展开
2个回答
展开全部
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Command1_Click()
Dim rt As RECT
GetWindowRect Me.hwnd, rt
ClipCursor rt
ShowCursor 0
Sleep 5000
ShowCursor 1
ClipCursor 0
End Sub
释放后鼠标随便点下就可以解除锁定了
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Command1_Click()
Dim rt As RECT
GetWindowRect Me.hwnd, rt
ClipCursor rt
ShowCursor 0
Sleep 5000
ShowCursor 1
ClipCursor 0
End Sub
释放后鼠标随便点下就可以解除锁定了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询