在Form中加入
Private Declare Function GetAsyncKeyState Lib "user32" _
(ByVal vkey As Long) As Integer
Private Function MyHotKey(vKeyCode) As Boolean
MyHotKey = GetAsyncKeyState(vKeyCode) < 0
End Function
然后在循环中或Timer的Timer事件中检测:
If myHotKey(vbkeyA) then .....
我觉得这个方法简单又好用,只要再加入一个API让热键按下后程序出现在最顶层就可以做一个呼出程序的热键了.