展开全部
'比如限止在客户区内
Private Declare Function ClipCursor& Lib "user32" (lpRect As RECT)
Private Declare Function ClipCursorBynum& Lib "user32" Alias "ClipCursor" (ByVal lpRect As Long)
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_DblClick()
Unload Me
End Sub
Private Sub Form_Load()
Dim r As RECT
GetClientRect Me.hwnd, r
Dim p As POINTAPI
ClientToScreen hwnd, p
r.Left = p.x
r.Top = p.y
r.Right = p.x + r.Right
r.Bottom = p.y + r.Bottom
ClipCursor r
End Sub
Private Sub Form_Unload(Cancel As Integer)
ClipCursorBynum 0
End Sub
更多追问追答
追问
你们辛苦了, 谢谢你们,
还有麻烦你们,我用上面的代码,没插入控件情况下,很经常,但是插入ezVidCap控件无效,怎么回事。。。。。
追答
ezVidCap 什么控件,没见过,或许这个控件会释放限定区域的吧,你把工程发过来看看,2978454279@qq.com
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询