Archive: Full createshortcut


Full createshortcut
Sorry for simple question, but I don't fint answer in search-result on forum.
1. How I set on CreateShortcut with Key "Win", for example Win+W?
2. If I can't make this , how skip shortcut and write description for lnk?


see example below:

SetShellVarContext all
CreateDirectory "$SMPROGRAMS\CompanyNameShort"
CreateShortCut "$SMPROGRAMS\CompanyNameShort\myshortcuttext.lnk" "$INSTFOLDER\myapp.exe" "" "$INSTFOLDER\myicon.ico" 0 SW_SHOWNORMAL "" "Extra hint text"


ofcourse you can also read the extra documentation in the manual.


Ah, you also wanted a keyboard shortcut, sorry forgot. Then use the following parameters

[parameters [icon.file [icon_index_number [start_options [keyboard_shortcut [description]]]]]]


Grrrr... i see I'm not awake yet, about the Winkey no clue (yet) but for exasmple use the key definition below:

CreateShortCut "$SMPROGRAMS\CompanyNameShort\myshortcuttext.lnk" "$INSTFOLDER\myapp.exe" "" "$INSTFOLDER\myicon.ico" 0 SW_SHOWNORMAL CONTROL|SHIFT|W "Try this application today!"


Thank you for all answers.
Badly Winkey can't be set... :(


The scan code for
- left Windows key is 0xe05b
- right Windows key is 0xe05c

So try to use these values instead of constants. Had no time to try myself yet.


Are you sure that's even possible? I couldn't define it using the properties dialog of a shortcut and the API also suggests it's impossible.


Will try it out myself by writing an Delphi app first. In the meantime the following info might come in handy.

wModifiers are the control keys (Shift, Ctrl, Alt, and the Windows key). The modifier flags defined in CommCtrl.h can be a combination of the following values:
#define HOTKEYF_SHIFT 0x01
#define HOTKEYF_CONTROL 0x02
#define HOTKEYF_ALT 0x04
#define HOTKEYF_EXT 0x08

Then the hot key has to be registered using:
BOOL RegisterHotKey(
HWND hWnd, // handle to window
int id, // hot key identifier
UINT fsModifiers, // key-modifier options
UINT vk // virtual-key code
);
The values for fsModifiers are defined in WinUser.h.
#define MOD_ALT 0x0001
#define MOD_CONTROL 0x0002
#define MOD_SHIFT 0x0004
#define MOD_WIN 0x0008


Registering a hot key with RegisterHotKey is another issue. The shortcuts might use that internally, but you need a running application to response to messages sent for that hotkey.


One more question
I have a question about shotcut hotkeys:
Is it possible to make a page in installer, where user can define HotKey which would be used in shotcut?
If it is can you tell me how to do this.

Thanks and sorry for my bad english.