Search code examples
wixwix3wix3.5

How to assign Hotkey for a shortcut which is deployed through Wix


I am trying to assign an HotKey (Ctrl+Alt+S) for a shortcut I deploy on Windows Desktop using Wix. Below is how I tried to assign the value. However the compiler says that the Hotkey value has to be a integer value.

<Shortcut Id="ToolsShortcut" WorkingDirectory="System" Icon="icon.vbs"      Directory="DesktopFolder" Hotkey="Ctrl+Alt+S" Description="Shortcut to Launch the Tools Framework" Name="Tools.lnk" Advertise="yes">

Please could anyone tell me how to determine the equivalent integer value for Ctrl+Alt+S

Currently I know that I have to somehow combine the Hex equivalent for the individual keys to create the Hotkey.

Here's a link to Virtual-Key Codes.

Below are the Hex values for the individual keys:

Ctrl: 11
Alt: 12
S: 53

Any help would be greatly appreciated.


Solution

  • You can use 1619 for Ctrl + Alt + S. It's a combination of the virtual key code and modifier flags. They are not really documented, but you can determine them through experiments.

    To get this number I used a Hot Key control and HKM_GETHOTKEY message.