Description: VB to set an example of shortcuts, custom shortcuts to open a program, this just an example that demonstrates the principles and specific code:
Dim bCancel As Boolean used to determine whether to exit the program
Public Sub RegFastKey () registration shortcuts
Dim ret As Long
bCancel = False
ret = RegisterHotKey (hwnd, & HBFFF &, MOD_CONTROL, vbKeyF)
ProcessMessages
End Sub
Public Sub UnRegFastKey ()
bCancel = True
UnregisterHotKey hwnd, & HBFFF &
End Sub
Private Sub ProcessMessages () listen shortcuts message
Dim Message As Msg
Do While Not bCancel
If PeekMessage (Message, hwnd, WM_HOTKEY, WM_HOTKEY, & H1) Then
MsgBox "shortcut"
End If
DoEvents
Loop
End Sub
To Search:
File list (Check if you may need any files):
快捷键\Form1.frm
......\Module1.bas
......\MSSCCPRJ.SCC
......\工程1.vbp
......\工程1.vbw
快捷键