Make your own Hotkey easy with API
The code is very easy to make your own systemwide hotkeys with API Call!
Assumes
Make a new module and put the API Call in the module.
You have to add a timer to your Form leave the standard name, put the intervall to 100 or when you want less or more you can do also, it is for how often he checks if the hotkey was pressed.
API Declarations
Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Rate Make your own Hotkey easy with API
(7(7 Vote))
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(vbKeyO) Then
MsgBox "It works :)"
End If
End Sub
'this example use the Control Key and O key as hotkey but you can use that key and how many keys you want alle the key codes you will find in the vb help under key code constants
Make your own Hotkey easy with API Comments
No comments yet — be the first to post one!
Post a Comment