1个回答
展开全部
绝对可用http://hi.baidu.com/loveee/blog/item/e51f99165f156759f3de3298.html
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_SHOWWINDOW = &H40
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim mouse As RECT
'将鼠标限制在屏幕左上角无法移动
Private Sub Form_Load()
Dim retValue As Long
retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, Screen.Width, Screen.Height, SWP_SHOWWINDOW)
mouse.Left = 0
mouse.Top = 0
mouse.Right = 0
mouse.Bottom = 0
ClipCursor mouse
End Sub
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_SHOWWINDOW = &H40
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim mouse As RECT
'将鼠标限制在屏幕左上角无法移动
Private Sub Form_Load()
Dim retValue As Long
retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, Screen.Width, Screen.Height, SWP_SHOWWINDOW)
mouse.Left = 0
mouse.Top = 0
mouse.Right = 0
mouse.Bottom = 0
ClipCursor mouse
End Sub
天正软件
2024-08-02 广告
2024-08-02 广告
天正软件可以解决以下问题:1. 提供设计标准化:天正软件专注于勘察设计领域,为用户提供标准化、信息化、智能化的解决方案,以提高设计效率、优化设计流程、降低成本。2. 提高绘图效率:天正软件提供了一系列专业绘图工具,能够帮助设计师快速绘制图纸...
点击进入详情页
本回答由天正软件提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询