Skip to content

Commit 8a22282

Browse files
committed
ItemManager: Better handling of modern application links
Link to modern application will be treat as modern application itself. This fixes jump-lists and invert metro color option on modern apps pinned to start menu.
1 parent 935600a commit 8a22282

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

Src/StartMenu/StartMenuDLL/ItemManager.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,11 @@ void CItemManager::RefreshItemInfo( ItemInfo *pInfo, int refreshFlags, IShellIte
18241824
{
18251825
newInfo.bLink=true;
18261826
pStore=pLink;
1827-
1827+
#ifdef _DEBUG
1828+
LOG_MENU(LOG_OPEN, L"Link: %s", newInfo.path);
1829+
LOG_MENU(LOG_OPEN, L"Link property store:");
1830+
LogPropertyStore(LOG_OPEN, pStore);
1831+
#endif
18281832
if (SUCCEEDED(pLink->GetIDList(&newInfo.targetPidl)))
18291833
{
18301834
wchar_t path[_MAX_PATH];
@@ -1833,6 +1837,28 @@ void CItemManager::RefreshItemInfo( ItemInfo *pInfo, int refreshFlags, IShellIte
18331837
CharUpper(path);
18341838
newInfo.targetPATH=path;
18351839
}
1840+
1841+
CComPtr<IShellItem> target;
1842+
if (SUCCEEDED(SHCreateItemFromIDList(newInfo.targetPidl, IID_PPV_ARGS(&target))))
1843+
{
1844+
CComPtr<IPropertyStore> store;
1845+
if (SUCCEEDED(target->BindToHandler(nullptr, BHID_PropertyStore, IID_PPV_ARGS(&store))))
1846+
{
1847+
#ifdef _DEBUG
1848+
LOG_MENU(LOG_OPEN, L"Target property store:");
1849+
LogPropertyStore(LOG_OPEN, store);
1850+
#endif
1851+
PROPVARIANT val;
1852+
PropVariantInit(&val);
1853+
if (SUCCEEDED(store->GetValue(PKEY_MetroAppLauncher, &val)) && (val.vt == VT_I4 || val.vt == VT_UI4) && val.intVal)
1854+
{
1855+
newInfo.bLink = false;
1856+
pItem = target;
1857+
pStore = store;
1858+
}
1859+
PropVariantClear(&val);
1860+
}
1861+
}
18361862
}
18371863
}
18381864
}

0 commit comments

Comments
 (0)