mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-20 02:34:41 +10:00
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.
This commit is contained in:
@@ -1824,7 +1824,11 @@ void CItemManager::RefreshItemInfo( ItemInfo *pInfo, int refreshFlags, IShellIte
|
|||||||
{
|
{
|
||||||
newInfo.bLink=true;
|
newInfo.bLink=true;
|
||||||
pStore=pLink;
|
pStore=pLink;
|
||||||
|
#ifdef _DEBUG
|
||||||
|
LOG_MENU(LOG_OPEN, L"Link: %s", newInfo.path);
|
||||||
|
LOG_MENU(LOG_OPEN, L"Link property store:");
|
||||||
|
LogPropertyStore(LOG_OPEN, pStore);
|
||||||
|
#endif
|
||||||
if (SUCCEEDED(pLink->GetIDList(&newInfo.targetPidl)))
|
if (SUCCEEDED(pLink->GetIDList(&newInfo.targetPidl)))
|
||||||
{
|
{
|
||||||
wchar_t path[_MAX_PATH];
|
wchar_t path[_MAX_PATH];
|
||||||
@@ -1833,6 +1837,28 @@ void CItemManager::RefreshItemInfo( ItemInfo *pInfo, int refreshFlags, IShellIte
|
|||||||
CharUpper(path);
|
CharUpper(path);
|
||||||
newInfo.targetPATH=path;
|
newInfo.targetPATH=path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CComPtr<IShellItem> target;
|
||||||
|
if (SUCCEEDED(SHCreateItemFromIDList(newInfo.targetPidl, IID_PPV_ARGS(&target))))
|
||||||
|
{
|
||||||
|
CComPtr<IPropertyStore> store;
|
||||||
|
if (SUCCEEDED(target->BindToHandler(nullptr, BHID_PropertyStore, IID_PPV_ARGS(&store))))
|
||||||
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
LOG_MENU(LOG_OPEN, L"Target property store:");
|
||||||
|
LogPropertyStore(LOG_OPEN, store);
|
||||||
|
#endif
|
||||||
|
PROPVARIANT val;
|
||||||
|
PropVariantInit(&val);
|
||||||
|
if (SUCCEEDED(store->GetValue(PKEY_MetroAppLauncher, &val)) && (val.vt == VT_I4 || val.vt == VT_UI4) && val.intVal)
|
||||||
|
{
|
||||||
|
newInfo.bLink = false;
|
||||||
|
pItem = target;
|
||||||
|
pStore = store;
|
||||||
|
}
|
||||||
|
PropVariantClear(&val);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user