[BUG_FIXED] Replace DeleteObject(hIcon) by DestroyIcon(hIcon)to save the kitties.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@361 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 2008-12-05 22:24:12 +00:00
parent c62bfed96c
commit 9552d39b01
1 changed files with 1 additions and 21 deletions

View File

@ -56,13 +56,10 @@ public :
void addIcon(int iconID) const {
HICON hIcon = ::LoadIcon(_hInst, MAKEINTRESOURCE(iconID));
//HBITMAP hBmp = (HBITMAP)::LoadImage(_hInst, MAKEINTRESOURCE(iconID), IMAGE_ICON, _iconSize, _iconSize, LR_LOADMAP3DCOLORS);
if (!hIcon)
throw int(26);
ImageList_AddIcon(_hImglst, hIcon);
//ImageList_AddMasked(_hImglst, hBmp, RGB(0, 0, 0));
::DeleteObject(hIcon);
//::DeleteObject(hBmp);
::DestroyIcon(hIcon);
};
bool changeIcon(int index, const TCHAR *iconLocation) const{
@ -74,24 +71,7 @@ public :
::DeleteObject(hBmp);
return (i == index);
};
/*
bool changeIcon(int index, const TCHAR *iconLocation, int size) const{
HBITMAP hBmp = (HBITMAP)::LoadImage(_hInst, iconLocation, IMAGE_ICON, size, size, LR_LOADFROMFILE | LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
if (!hBmp)
return false;
int i = ImageList_ReplaceIcon(_hImglst, index, (HICON)hBmp);
::DeleteObject(hBmp);
return (i == index);
};*/
/*
void addImage(int iconID) const {
HBITMAP hBmp = ::LoadBitmap(_hInst, MAKEINTRESOURCE(TEXT("STD_FILEOPEN")));
//HBITMAP hBmp = (HBITMAP)::LoadImage(_hInst, MAKEINTRESOURCE(iconID), IMAGE_ICON, _iconSize, _iconSize, LR_LOADMAP3DCOLORS);
ImageList_Add(_hImglst, hBmp, NULL);
::DeleteObject(hBmp);
};
*/
void setIconSize(int size) const {
ImageList_SetIconSize(_hImglst, size, size);
for (int i = 0 ; i < _iconIDArraySize ; i++)