只需要一个定时器就可以了。
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As IntegerPrivate Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
Private Sub Timer1_Timer() If MyHotKey(vbKeyA) Then '如果按下字母A键 End '结束自己 End IfEnd Sub
Private Function MyHotKey(vKeyCode) As Boolean MyHotKey = (GetAsyncKeyState(vKeyCode) < 0)End Function