fixed icon handle leak in notification area

svn path=/trunk/; revision=8337
This commit is contained in:
Martin Fuchs 2004-02-23 20:36:21 +00:00
parent 717ccf2aa4
commit 8c1f187f6e
2 changed files with 8 additions and 5 deletions

View file

@ -22,7 +22,6 @@
- implement more than one column for very crowded start menus
- Execute selected programs with additional command line options ("Run" dialog with pre-filled edit field)
- GDI-Leaks
- autostart doesn't on NT4 ?
- Startmenu: You can't close the start menu with pressing Win-key You can open the start menu

View file

@ -68,10 +68,14 @@ NotifyInfo& NotifyInfo::operator=(NOTIFYICONDATA* pnid)
if (pnid->uFlags & NIF_MESSAGE)
_uCallbackMessage = pnid->uCallbackMessage;
if (pnid->uFlags & NIF_ICON)
// Some applications destroy the icon immediatelly after completing the,
// NIM_ADD/MODIFY message, so we have to make a copy if it.
if (pnid->uFlags & NIF_ICON) {
// Some applications destroy the icon immediatelly after completing the
// NIM_ADD/MODIFY message, so we have to make a copy of it.
if (_hIcon)
DestroyIcon(_hIcon);
_hIcon = (HICON) CopyImage(pnid->hIcon, IMAGE_ICON, 16, 16, 0);
}
#ifdef NIF_STATE // currently (as of 21.08.2003) missing in MinGW headers
if (pnid->uFlags & NIF_STATE)
@ -287,7 +291,7 @@ void NotifyArea::Paint()
// draw icons
int x = 2;
int y = 2;
int y = 3;
for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
DrawIconEx(canvas, x, y, it->_hIcon, 16, 16, 0, 0, DI_NORMAL);