63 return ImageList_GetImageCount(
hSmall );
68 return ImageList_GetIcon(
hSmall, Ix, ILD_NORMAL );
73 return ImageList_GetIcon(
hLarge, Ix, ILD_NORMAL );
78 int Ix, Flg = SHGFI_SYSICONINDEX| SHGFI_USEFILEATTRIBUTES;
79 if (Small) Flg |= SHGFI_SMALLICON;
84 HIMAGELIST hIml = (HIMAGELIST)
85 SHGetFileInfo( dotExt, FILE_ATTRIBUTE_NORMAL, &
Info,
sizeof(
Info), Flg );
86 if (hIml) Ix =
Info.iIcon;
93 int Ix, Flg = SHGFI_SYSICONINDEX;
94 HIMAGELIST hIml = (HIMAGELIST)
95 SHGetFileInfo( FName, FILE_ATTRIBUTE_NORMAL, &
Info,
sizeof(
Info), Flg );
96 if (hIml) Ix =
Info.iIcon;
103 HICON hIco = LoadIcon( hInst, Id );
104 if (hIco) ImageList_ReplaceIcon(
hLarge, Ix, hIco );
106 if (hIco) ImageList_ReplaceIcon(
hSmall, Ix, hIco );
107 return (hIco != NULL);
110 #if !SYSIMG_USE_COMIFACE 122 #else // Use IImageList (seems to comply w sysimg list internals). 136 if (SUCCEEDED( SHGetImageList( SHIL_LARGE, IID_IImageList, (
void**)&pIml )))
138 pIml->ReplaceIcon( -1, LoadIcon( hInst, Id ), &imgIx );
141 if (SUCCEEDED( SHGetImageList( SHIL_SMALL, IID_IImageList, (
void**)&pIml )))
HICON WINAPI LoadSmallIcon(HINSTANCE hInst, CSTR Id)
static BOOL WINAPI Shell_GetImageLists(HIMAGELIST *pimlLarge, HIMAGELIST *pimSmall)
bool InitShellFunc(bool useOle=false, DWORD coFlag=COINIT_APARTMENTTHREADED)
int GetFiletypeIconIndex(CSTR dotExt, bool Small)
bool ShellFuncInitialized()
#define I_NOIMAGE
Equivalent to I_IMAGENONE.
HICON GetLargeIcon(UINT Ix)
BOOL(WINAPI *SysImgList::Shell_GetImageLists)(HIMAGELIST *pimlLarge
static BOOL WINAPI FileIconInit(BOOL bFullInit)
int AddIcon(HINSTANCE hInst, CSTR Id)
bool ReplaceIcon(UINT Ix, HINSTANCE hInst, CSTR Id)
int GetFileIconIndex(CSTR FName, bool Small)
HICON GetSmallIcon(UINT Ix)