Skip to content

Commit 729c368

Browse files
Start button's context menu: add the Win+X menu (#2578)
Open-Shell takes over the right-click on the start button, which in Windows opens the Win+X menu (Terminal (Admin), Device Manager, Disk Management and so on). Shift+right-click still opens it, but nothing on screen says so, and the Controls setting can only swap the two menus, not offer both. Win+X Menu is now in the context menu, in the section of Windows Explorer and Open, on Windows 8 and later. It calls ShowWinX(), as Shift+right-click does. EnableExplorer doesn't remove it: that setting is about opening folders, and Win+X opens none. The help's Operation section mentions Shift+right-click and the new item. Menu.WinXMenu is a new string, in English only for now. A Start Menu (Windows) item was in an earlier version and was dropped in review: Open-Shell's own menu has that item by default.
1 parent 7e6a31b commit 729c368

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎Src/Localization/English/StartMenu.html‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ <h1><a name="operation"></a> Operation</h1>
107107
<p>
108108
Hold down Shift while clicking on the orb to access the operating
109109
system's own
110-
Start menu.
110+
Start menu. By default Shift+right-click on the orb opens the Win+X menu of Windows. It is
111+
also in the orb's right-click menu, as Win+X Menu.
111112
</p>
112113
<p>
113114
Click on an item to execute it.

‎Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4134,6 +4134,7 @@ if (!g_bTrimHooks)
41344134
CMD_EXPLORER,
41354135
CMD_OPEN_PINNED,
41364136
CMD_RELOAD,
4137+
CMD_WINX,
41374138
};
41384139

41394140
// right-click on the start button - open the context menu (Settings, Help, Exit)
@@ -4151,7 +4152,8 @@ if (!g_bTrimHooks)
41514152
AppendMenu(menu,MF_SEPARATOR,0,0);
41524153
}
41534154
int count0=GetMenuItemCount(menu);
4154-
if (GetSettingBool(L"EnableExplorer"))
4155+
bool bExplorer=GetSettingBool(L"EnableExplorer");
4156+
if (bExplorer)
41554157
{
41564158
if (!GetSettingString(L"ExplorerPath").IsEmpty())
41574159
AppendMenu(menu,MF_STRING,CMD_EXPLORER,FindTranslation(L"Menu.Explorer",L"Windows Explorer"));
@@ -4160,8 +4162,13 @@ if (!g_bTrimHooks)
41604162
AppendMenu(menu,MF_STRING,CMD_OPEN_ALL,FindTranslation(L"Menu.OpenAll",L"O&pen All Users"));
41614163
if (GetSettingInt(L"PinnedPrograms")==PINNED_PROGRAMS_PINNED)
41624164
AppendMenu(menu,MF_STRING,CMD_OPEN_PINNED,FindTranslation(L"Menu.OpenPinned",L"O&pen Pinned"));
4163-
AppendMenu(menu,MF_SEPARATOR,0,0);
41644165
}
4166+
// the Win+X menu of Windows, which Shift+right-click opens, for those who don't know the shortcut.
4167+
// it doesn't open folders, so EnableExplorer doesn't remove it
4168+
if (winVer>=WIN_VER_WIN8)
4169+
AppendMenu(menu,MF_STRING,CMD_WINX,FindTranslation(L"Menu.WinXMenu",L"Win+X Menu"));
4170+
if (bExplorer || winVer>=WIN_VER_WIN8)
4171+
AppendMenu(menu,MF_SEPARATOR,0,0);
41654172
if (GetSettingBool(L"EnableSettings"))
41664173
AppendMenu(menu,MF_STRING,CMD_SETTINGS,FindTranslation(L"Menu.MenuSettings",L"Settings"));
41674174
if (HasHelp())
@@ -4190,6 +4197,10 @@ if (!g_bTrimHooks)
41904197
int res=TrackPopupMenu(menu,TPM_RIGHTBUTTON|TPM_RETURNCMD|(IsLanguageRTL()?TPM_LAYOUTRTL:0),pt0.x,pt0.y,0,msg->hwnd,NULL);
41914198
DestroyMenu(menu);
41924199
g_bInMenu=false;
4200+
if (res==CMD_WINX)
4201+
{
4202+
ShowWinX(); // as Shift+right-click does
4203+
}
41934204
if (res==CMD_SETTINGS)
41944205
{
41954206
EditSettings(false,0);

‎Src/StartMenu/StartMenuL10N.ini‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ Menu.Explorer = Windows Explorer
10841084
Menu.Start = Start
10851085
Menu.StartScreen = Start Screen
10861086
Menu.StartMenu = Start Menu (Windows)
1087+
Menu.WinXMenu = Win+X Menu
10871088
Menu.PinStart = Pin to Start menu
10881089
Menu.PinStartCs = Pin to Start menu (Open-Shell)
10891090
Menu.UnpinStartCs = Unpin from Start menu (Open-Shell)

0 commit comments

Comments
 (0)