VB鼠标问题
我想设计一个程序,打开程序后,无论鼠标在不在窗体内,只要单击,马上退出程序谢谢2楼的API函数再加PrivateDeclareFunctionGetAsyncKeySta...
我想设计一个程序,打开程序后,无论鼠标在不在窗体内,只要单击,马上退出程序
谢谢
2楼的API函数再加
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
就好了 展开
谢谢
2楼的API函数再加
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
就好了 展开
展开全部
'API函数声明
Private Declare Function BitBlt Lib "gdi32" ( _
ByVal hDestDC As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
Dim objEmail As Object
Dim strName As String
Private Sub Form_Load()
Timer1.Interval = 100 'Interval的值应 > 0
End Sub
'监控鼠标
Private Sub Timer1_Timer()
For i = 32 To 256
X = GetAsyncKeyState(i)
X = GetAsyncKeyState(1)
If X = -32767 Then
End
End If
Next i
End Sub
Private Declare Function BitBlt Lib "gdi32" ( _
ByVal hDestDC As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
Dim objEmail As Object
Dim strName As String
Private Sub Form_Load()
Timer1.Interval = 100 'Interval的值应 > 0
End Sub
'监控鼠标
Private Sub Timer1_Timer()
For i = 32 To 256
X = GetAsyncKeyState(i)
X = GetAsyncKeyState(1)
If X = -32767 Then
End
End If
Next i
End Sub
展开全部
使用Hook监视鼠标活动,有活动就End程序即可
监视方法见此:http://www.baidu.com/s?bs=VB+%CA%F3%B1%EA%BB%EE%B6%AF&f=8&wd=VB+%BC%E0%CA%D3%CA%F3%B1%EA%BB%EE%B6%AF
监视方法见此:http://www.baidu.com/s?bs=VB+%CA%F3%B1%EA%BB%EE%B6%AF&f=8&wd=VB+%BC%E0%CA%D3%CA%F3%B1%EA%BB%EE%B6%AF
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询