Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Src/StartMenu/StartMenuDLL/MenuCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,19 @@ void CMenuContainer::ExecuteCommand( const wchar_t *command, bool bElevated, boo
}
}

// Opens the Control Panel in the category view (ControlPanelCategory setting)
static void OpenControlPanelCategory( void )
{
// the category view home is the {26EE0668-A00A-44D7-9371-BEB064C98683} shell folder
CAbsolutePidl pidl;
if (FAILED(SHParseDisplayName(L"::{26EE0668-A00A-44D7-9371-BEB064C98683}",NULL,&pidl,0,NULL)))
return;
SHELLEXECUTEINFO execute={sizeof(execute),SEE_MASK_IDLIST|SEE_MASK_FLAG_LOG_USAGE};
execute.lpIDList=pidl;
execute.nShow=SW_SHOWNORMAL;
ShellExecuteEx(&execute);
}

// Dialog proc for the Log Off dialog box
static INT_PTR CALLBACK LogOffDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
Expand Down Expand Up @@ -1576,6 +1589,26 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
if (item.id==MENU_EMPTY || item.id==MENU_EMPTY_TOP) return;
if (item.bFolder && pItemPidl1 && !item.bSplit && !GetSettingBool(L"EnableExplorer"))
return;
// open the Control Panel in the category view if enabled (ControlPanelCategory setting)
if (GetSettingBool(L"ControlPanelCategory") && (pItemPidl1 || pItemPidl2))
{
CAbsolutePidl pidlCP;
if (SUCCEEDED(ShGetKnownFolderIDList(FOLDERID_ControlPanelFolder,&pidlCP)) &&
((pItemPidl1 && ILIsEqual(pItemPidl1,pidlCP)) || (pItemPidl2 && ILIsEqual(pItemPidl2,pidlCP))))
{
if (bKeepOpen)
LockSetForegroundWindow(LSFW_LOCK);
else
{
LockSetForegroundWindow(LSFW_UNLOCK);
FadeOutItem(index);
CloseSubMenus(CLOSE_POST,NULL);
}
PlayMenuSound(SOUND_COMMAND);
OpenControlPanelCategory();
return;
}
}
if (item.id==MENU_SEARCH_BOX)
{
// the search button was pressed
Expand Down
1 change: 1 addition & 0 deletions Src/StartMenu/StartMenuDLL/SettingsUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4337,6 +4337,7 @@ CSetting g_Settings[]={
{L"Date",CSetting::TYPE_RADIO,IDS_SORT_DATE,IDS_SORT_DATE_TIP},
{L"StartScreenShortcut",CSetting::TYPE_BOOL,IDS_STARTSCREEN_ITEM,IDS_STARTSCREEN_ITEM_TIP,1},
{L"ControlPanelCategories2",CSetting::TYPE_BOOL,IDS_CP_CATEGORIES2,IDS_CP_CATEGORIES_TIP,0,CSetting::FLAG_MENU_WIN7},
{L"ControlPanelCategory",CSetting::TYPE_BOOL,IDS_CP_VIEW,IDS_CP_VIEW_TIP,0},
{L"MainSortZA",CSetting::TYPE_BOOL,IDS_MAIN_SORTZA,IDS_SORTZA_TIP,0},
{L"MainSortOnce",CSetting::TYPE_BOOL,IDS_MAIN_SORTONCE,IDS_SORTONCE_TIP,0},

Expand Down
2 changes: 2 additions & 0 deletions Src/StartMenu/StartMenuDLL/StartMenuDLL.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,8 @@ BEGIN
IDS_SEARCH_MAX_TIP2 "Limit the number of results shown per category"
IDS_SEARCH_MAX3 "Results per maximized category"
IDS_SEARCH_MAX_TIP3 "Limit the number of results shown for the maximized category"
IDS_CP_VIEW "Open Control Panel in Category view"
IDS_CP_VIEW_TIP "Open the Control Panel in the category view instead of the icon view"
IDS_SHOW_APPS "Show Metro apps"
IDS_SHOW_APPS_TIP "When this is checked, the programs tree will include a folder for the Metro apps"
IDS_FOLDERS_FIRST "Show folders first"
Expand Down
3 changes: 3 additions & 0 deletions Src/StartMenu/StartMenuDLL/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@
#define IDS_STRING7110 7110
#define IDS_STRING7111 7111

#define IDS_CP_VIEW 3700
#define IDS_CP_VIEW_TIP 3701

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
Expand Down