uLib
User mode C/C++ extended API library for Win32 programmers.
|
#include <uLib/SysImgList.h>
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 |
SysImgList::SysImgList | ( | ) |
Load Shell32 and initialize the image lists.
Definition at line 26 of file SysImgList.cpp.
UINT SysImgList::Count | ( | ) |
ImageList_GetImageCount( hSmall )
Definition at line 60 of file SysImgList.cpp.
HICON SysImgList::GetSmallIcon | ( | UINT | Ix | ) |
Don't forget DestroyIcon().
Definition at line 66 of file SysImgList.cpp.
HICON SysImgList::GetLargeIcon | ( | UINT | Ix | ) |
Don't forget DestroyIcon().
Definition at line 71 of file SysImgList.cpp.
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.
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.
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.)
|
static |
(Pointer to Shell32 function 71. Used internally.)
bool SysImgList::ReplaceIcon | ( | UINT | Ix, |
HINSTANCE | hInst, | ||
CSTR | Id | ||
) |
See ImageList_ReplaceIcon().
Definition at line 101 of file SysImgList.cpp.
int SysImgList::AddIcon | ( | HINSTANCE | hInst, |
CSTR | Id | ||
) |
See ImageList_AddIcon().
Definition at line 115 of file SysImgList.cpp.
|
static |
16x16 icons.
Definition at line 74 of file SysImgList.h.
|
static |
32x32 icons.
Definition at line 75 of file SysImgList.h.
SHFILEINFO SysImgList::Info |
Used by GetFiletypeIconIndex() and GetFileIconIndex().
Definition at line 77 of file SysImgList.h.
|
staticprotected |
Do not unload! Let the OS do that on process exit.
Definition at line 116 of file SysImgList.h.