1

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.

2 Answers 2

1

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.

2
  • 1
    thanks. i tried assigning 1619 to the Hotkey attribute but it did not work. Please could you let me know how did you come up with that number.
    – coder
    Mar 17, 2011 at 8:48
  • 1619 does work. apparently hotkeys was disabled by default on my windows XP OS. i had to enable it by making an entry in the registry.
    – coder
    Mar 17, 2011 at 10:48
1

Whether you find it or not, beware of the warning placed in the wix.chm:

Authors of installation packages are generally recommend not to set this option, because this can add duplicate hotkeys to a users desktop. In addition, the practice of assigning hotkeys to shortcuts can be problematic for users using hotkeys for accessibility.

1
  • thanks. i read that before but its part of the requirement for the project i am working on.
    – coder
    Mar 17, 2011 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.