@@ -1164,6 +1164,10 @@ const CItemManager::ItemInfo* CItemManager::GetLinkIcon(IShellLink* link, TIconS
1164
1164
CComPtr<IResourceMap> resMap;
1165
1165
if (SUCCEEDED (resManager->GetMainResourceMap (IID_PPV_ARGS (&resMap))))
1166
1166
{
1167
+ CComPtr<IResourceContext> resContext;
1168
+ if (SUCCEEDED (resManager->GetDefaultContext (IID_PPV_ARGS (&resContext))))
1169
+ resContext->SetTargetSize (GetIconSize (iconSizeType));
1170
+
1167
1171
CComString location;
1168
1172
if (SUCCEEDED (resMap->GetFilePath (logoUri, &location)))
1169
1173
return GetCustomIcon (location, -65536 , iconSizeType, true );
@@ -3585,6 +3589,26 @@ void CItemManager::ClearCache( void )
3585
3589
item.extraLargeIcon =m_DefaultExtraLargeIcon;
3586
3590
}
3587
3591
3592
+ int CItemManager::GetIconSize (TIconSizeType iconSizeType) const
3593
+ {
3594
+ switch (iconSizeType)
3595
+ {
3596
+ case ICON_SIZE_TYPE_SMALL:
3597
+ case ICON_SIZE_TYPE_SMALL_METRO:
3598
+ return SMALL_ICON_SIZE;
3599
+
3600
+ case ICON_SIZE_TYPE_LARGE:
3601
+ case ICON_SIZE_TYPE_LARGE_METRO:
3602
+ return LARGE_ICON_SIZE;
3603
+
3604
+ case ICON_SIZE_TYPE_EXTRA_LARGE:
3605
+ case ICON_SIZE_TYPE_EXTRA_LARGE_METRO:
3606
+ return EXTRA_LARGE_ICON_SIZE;
3607
+ }
3608
+
3609
+ return 0 ;
3610
+ }
3611
+
3588
3612
// retrieves the pidl and the SFGAO_FOLDER, SFGAO_STREAM, SFGAO_LINK flags for the path
3589
3613
// for paths starting with \\ tries to guess if it is a folder or a link based on the extension
3590
3614
HRESULT MenuParseDisplayName ( const wchar_t *path, PIDLIST_ABSOLUTE *pPidl, SFGAOF *pFlags, TNetworkType *pNetworkType )
0 commit comments