uLib  User mode C/C++ extended API library for Win32 programmers.
SysImgList Class Reference

#include <uLib/SysImgList.h>

Detailed Description

Access the system image lists the hard-core way..

Note: Direct use of ImageList_Draw() results in superior drawing speed,
far outperforming both ImageList_GetIcon()/DrawIconEx() and IImageList::Draw().

If you need sizes apart from 16 and 32, you're confined to IImageList,
so say goodbye to decent performace, since you won't get it's HIMAGELIST.

Definition at line 72 of file SysImgList.h.

Public Data

SHFILEINFO Info
 

Static Public Attributes

static HIMAGELIST hSmall = NULL
 
static HIMAGELIST hLarge = NULL
 

Public Functions

 SysImgList ()
 
UINT Count ()
 
HICON GetSmallIcon (UINT Ix)
 
HICON GetLargeIcon (UINT Ix)
 
int GetFiletypeIconIndex (CSTR dotExt, bool Small)
 
int GetFileIconIndex (CSTR FName, bool Small)
 
bool ReplaceIcon (UINT Ix, HINSTANCE hInst, CSTR Id)
 
int AddIcon (HINSTANCE hInst, CSTR Id)
 

Static Public Member Functions

static BOOL WINAPI FileIconInit (BOOL bFullInit)
 
static BOOL WINAPI Shell_GetImageLists (HIMAGELIST *pimlLarge, HIMAGELIST *pimSmall)
 

Static Protected Attributes

static HMODULE _hShell32 = NULL
 

Constructor & Destructor Documentation

◆ SysImgList()

SysImgList::SysImgList ( )

Load Shell32 and initialize the image lists.

Definition at line 26 of file SysImgList.cpp.

Member Function Documentation

◆ Count()

UINT SysImgList::Count ( )

ImageList_GetImageCount( hSmall )

Definition at line 60 of file SysImgList.cpp.

◆ GetSmallIcon()

HICON SysImgList::GetSmallIcon ( UINT  Ix)

Don't forget DestroyIcon().

Definition at line 66 of file SysImgList.cpp.

◆ GetLargeIcon()

HICON SysImgList::GetLargeIcon ( UINT  Ix)

Don't forget DestroyIcon().

Definition at line 71 of file SysImgList.cpp.

◆ GetFiletypeIconIndex()

int SysImgList::GetFiletypeIconIndex ( CSTR  dotExt,
bool  Small 
)

Get the index of the icon associated with the dotExt file extension.
On error, I_NOIMAGE is returned.

Definition at line 76 of file SysImgList.cpp.

◆ GetFileIconIndex()

int SysImgList::GetFileIconIndex ( CSTR  FName,
bool  Small 
)

Get the index of the icon associated with the FName file.
On error, I_NOIMAGE is returned.

Definition at line 91 of file SysImgList.cpp.

◆ FileIconInit()

static BOOL WINAPI SysImgList::FileIconInit ( BOOL  bFullInit)
static

Note: FileIconInit() must be called again in response to a WM_SETTINGCHANGE
message, when the SPI_SETNONCLIENTMETRICS flag is set.
(Pointer to Shell32 function 660. Used internally.)

◆ Shell_GetImageLists()

static BOOL WINAPI SysImgList::Shell_GetImageLists ( HIMAGELIST *  pimlLarge,
HIMAGELIST *  pimSmall 
)
static

(Pointer to Shell32 function 71. Used internally.)

◆ ReplaceIcon()

bool SysImgList::ReplaceIcon ( UINT  Ix,
HINSTANCE  hInst,
CSTR  Id 
)

See ImageList_ReplaceIcon().

Definition at line 101 of file SysImgList.cpp.

◆ AddIcon()

int SysImgList::AddIcon ( HINSTANCE  hInst,
CSTR  Id 
)

See ImageList_AddIcon().

Definition at line 115 of file SysImgList.cpp.

Member Data Documentation

◆ hSmall

HIMAGELIST SysImgList::hSmall = NULL
static

16x16 icons.

Definition at line 74 of file SysImgList.h.

◆ hLarge

HIMAGELIST SysImgList::hLarge = NULL
static

32x32 icons.

Definition at line 75 of file SysImgList.h.

◆ Info

SHFILEINFO SysImgList::Info

Used by GetFiletypeIconIndex() and GetFileIconIndex().

Definition at line 77 of file SysImgList.h.

◆ _hShell32

HMODULE SysImgList::_hShell32 = NULL
staticprotected

Do not unload! Let the OS do that on process exit.

Definition at line 116 of file SysImgList.h.


The documentation for this class was generated from the following files: