请问最简洁的 后台按键代码怎么写? 比如按F1,出来个提示框。后台,一定要是最简单的 (VB. 6.0)
1个回答
展开全部
'放一个Timer
Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
SendKeys ("{F1}") '这是按键
Timer1.Interval = 200
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbkef1) = 32767 Then MsgBox ("") '这是捕捉按键
End Sub
'你的问题不明确,请补充
Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
SendKeys ("{F1}") '这是按键
Timer1.Interval = 200
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbkef1) = 32767 Then MsgBox ("") '这是捕捉按键
End Sub
'你的问题不明确,请补充
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询