There is a bug in JclShell.pas concerning ShellLink Shortcuts. I have made a small demo app which demonstrates this bug and provides a fix for it:
Create a ShellLink Shortcut somewhere (which is a file with a .LNK extension) and enter a hotkey for it containing MODIFIER KEYS, for example:
Now start the demo app:
JclShell_BugFix.zip
...and load the ShortcutLink. You will notice that the MODIFIER KEYS are missing from the hotkey:
To activate the bug fix, uncomment these lines in the demo app source code:
// Get the MODIFIER KEYS from SL.HotKey:
HotKeyModifiers := Hi(SL.HotKey);
HotKey1.Modifiers := [];
if (HotKeyModifiers and HOTKEYF_ALT) = HOTKEYF_ALT then
HotKey1.Modifiers := HotKey1.Modifiers + [hkAlt];
if (HotKeyModifiers and HOTKEYF_CONTROL) = HOTKEYF_CONTROL then
HotKey1.Modifiers := HotKey1.Modifiers + [hkCtrl];
if (HotKeyModifiers and HOTKEYF_SHIFT) = HOTKEYF_SHIFT then
HotKey1.Modifiers := HotKey1.Modifiers + [hkShift];
if (HotKeyModifiers and HOTKEYF_EXT) = HOTKEYF_EXT then
HotKey1.Modifiers := HotKey1.Modifiers + [hkExt];
...and recompile the demo app and then run it which will get you the missing MODIFIER KEYS:
Now let's try the opposite way:
Manually enter another hotkey in the HotKey box on the demo app, for example:
Then SAVE the ShellLink Shortcut in any location you want by clicking the button "Save Shortcut Link". You will again notice that the MODIFIER KEYS are again missing from the hotkey of the saved ShellLink Shortcut:
Now UNCOMMENT the following code-line in the demo app source code, to include the MODIFIER KEYS in the hotkey of the saved ShellLink Shortcut and then recompile the demo app:
SL.HotKey := Winapi.Windows.MakeWord(Byte(HotKey1.HotKey), Byte(HotKey1.Modifiers));
...and you will get the desired result in the saved ShellLink Shortcut: