Search modern settings using our new shell folder

Use our modern settings shell folder (`shell:::{82E749ED-B971-4550-BAF7-06AA2BF7E836}`)
to search (enumerate) modern settings.

Fixes #57
This commit is contained in:
ge0rdi
2020-08-23 16:20:55 +02:00
parent 1f57c782e5
commit 0da20180ac
4 changed files with 67 additions and 30 deletions

View File

@@ -2192,11 +2192,15 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
if (res==CMD_PINSETTING)
{
CSearchManager::TItemCategory cat=(CSearchManager::TItemCategory)(item.categoryHash&CSearchManager::CATEGORY_MASK);
if (cat==CSearchManager::CATEGORY_SETTING)
CreatePinLink(pItemPidl1,item.name,NULL,0);
else if (cat==CSearchManager::CATEGORY_METROSETTING)
CreatePinLink(pItemPidl1,item.name,L"%windir%\\ImmersiveControlPanel\\systemsettings.exe",0);
CString iconPath;
if (item.pItemInfo)
{
CItemManager::RWLock lock(&g_ItemManager, false, CItemManager::RWLOCK_ITEMS);
if (_wcsicmp(PathFindExtension(item.pItemInfo->GetPath()), L".settingcontent-ms") == 0)
iconPath = L"%windir%\\ImmersiveControlPanel\\systemsettings.exe";
}
CreatePinLink(pItemPidl1, item.name, iconPath.IsEmpty() ? nullptr : iconPath.GetString(), 0);
m_bRefreshItems=true;
}