Prevent Win from opening the Start menu [Any Version]
Posted: 21 Mar 2022, 17:26
~LWin::vkE8
Now pressing the Win key by itself will not show the Start menu, yet you may use any Win key hotkey.
With the Win key thus disabled, the Start menu can also be opened by pressing Ctrl+Esc.
The Start menu will only appear if the Win key was pressed and released without any other key being pressed inbetween.
This script will press an unassigned key any time you press Win. Because of this, the Start menu will not appear.
(Menu bars work similarly, but with Alt.)
The other Win key can be disabled in the same way, but with RWin instead of LWin.
vkE8 is an "unassigned" key. The vk07 key was commonly used for this purpose before Windows 10, in which it opens the Game Bar.
For more details, see:
Blocking the keyboard Windows key
#MenuMaskKey
This does not work on elevated windows unless the script is elevated (run as admin) because unelevated processes cannot send keystrokes to elevated windows.
———
Alternatively:
~LWin::Send "{Blind}{vkE8}"
The former command will hold down the "vkE8" key while LWin is pressed and release it when Win is released, whereas this command will simply send vkE8 up+down when LWin is pressed.
It may have side effects on older versions.
———
I have posted this in the tutorials section because there is no tutorial for this yet — only dozens of threads all across the internet asking for this and either getting shrugs, horrible black magic or LWin::return.
This is the traditional and right way to block the Start menu without preventing its use in hotkeys.
Well, other than patching explorer.exe or using another shell.
Now pressing the Win key by itself will not show the Start menu, yet you may use any Win key hotkey.
With the Win key thus disabled, the Start menu can also be opened by pressing Ctrl+Esc.
The Start menu will only appear if the Win key was pressed and released without any other key being pressed inbetween.
This script will press an unassigned key any time you press Win. Because of this, the Start menu will not appear.
(Menu bars work similarly, but with Alt.)
The other Win key can be disabled in the same way, but with RWin instead of LWin.
vkE8 is an "unassigned" key. The vk07 key was commonly used for this purpose before Windows 10, in which it opens the Game Bar.
For more details, see:
Blocking the keyboard Windows key
#MenuMaskKey
This does not work on elevated windows unless the script is elevated (run as admin) because unelevated processes cannot send keystrokes to elevated windows.
———
Alternatively:
~LWin::Send "{Blind}{vkE8}"
The former command will hold down the "vkE8" key while LWin is pressed and release it when Win is released, whereas this command will simply send vkE8 up+down when LWin is pressed.
It may have side effects on older versions.
———
I have posted this in the tutorials section because there is no tutorial for this yet — only dozens of threads all across the internet asking for this and either getting shrugs, horrible black magic or LWin::return.
This is the traditional and right way to block the Start menu without preventing its use in hotkeys.
Well, other than patching explorer.exe or using another shell.