The hash is a totally different command. If you search the index in the autohotkey documentation, you will find an entry for both IfWinActive
and #IfWinActive
.
[The hash...] Creates context-sensitive hotkeys and hotstrings. Such hotkeys perform a different action (or none at all) depending on the type of window that is active or exists.
The #IfWin directives are positional: they affect all hotkeys and hotstrings physically beneath them in the script. They are also mutually exclusive; that is, only the most recent one will be in effect.
The #
only represents the windows key when you use it as a hotkey assignment designation. In AutoHotkey, any time you see a #
at the beginning of a command it has something to do with AutoHotkey directives.
Conclusion:
If you just want regular if
-else
statemens and don't need to affect the context of hotkeys, then don't use the #
.