我在https://msdn.microsoft.com/en-us/library/windows/desktop/bb773992(v=vs.85).aspx設置一個熱鍵爲一個可執行文件的快捷方式在.NET
Private Sub SetHotkey(FilePath As String)
Const ssfPROGRAMS = 2 'Program Files
Dim MyShell As Shell32.Shell = New Shell32.Shell
Dim MyFolder As Shell32.Folder = MyShell.NameSpace(ssfPROGRAMS)
If (MyFolder IsNot Nothing) Then
Dim MyFolderItem As Shell32.FolderItem = MyFolder.ParseName(FilePath)
If (MyFolderItem IsNot Nothing) Then
Dim MyShellLink As ShellLinkObject = MyFolderItem.GetLink
If (MyShellLink IsNot Nothing) Then
MyShellLink.Hotkey = <<What goes here?>>
MyShellLink.Save()
End If
MyShellLink = Nothing
End If
MyFolderItem = Nothing
End If
End Sub
下面的代碼(基於指令,我不能確定,雖然把該值作爲熱鍵。例如,如果我想不要按Ctrl + Alt鍵+一個。我會把什麼樣的價值?(我想按Ctrl + Alt鍵是 6,但我不知道如何在字符鍵放)。