From 9552d39b01212fc601bf9ef840d6493e8af364f0 Mon Sep 17 00:00:00 2001 From: donho Date: Fri, 5 Dec 2008 22:24:12 +0000 Subject: [PATCH] [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 --- .../WinControls/ImageListSet/ImageListSet.h | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h index 24a3a033e..ec87929c5 100644 --- a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h +++ b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h @@ -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++)