mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:53:05 +00:00
- Don't delete icons that we got by WM_GETICON or GetClassIcon.
svn path=/trunk/; revision=9463
This commit is contained in:
parent
4c8d47cc6b
commit
1c1f4e3945
1 changed files with 6 additions and 1 deletions
|
@ -319,13 +319,18 @@ BOOL CALLBACK TaskBar::EnumWndProc(HWND hwnd, LPARAM lparam)
|
||||||
} else {
|
} else {
|
||||||
HBITMAP hbmp;
|
HBITMAP hbmp;
|
||||||
HICON hIcon = get_window_icon_small(hwnd);
|
HICON hIcon = get_window_icon_small(hwnd);
|
||||||
|
BOOL delete_icon = FALSE;
|
||||||
|
|
||||||
if (!hIcon)
|
if (!hIcon)
|
||||||
|
{
|
||||||
hIcon = LoadIcon(0, IDI_APPLICATION);
|
hIcon = LoadIcon(0, IDI_APPLICATION);
|
||||||
|
delete_icon = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (hIcon) {
|
if (hIcon) {
|
||||||
hbmp = create_bitmap_from_icon(hIcon, GetSysColorBrush(COLOR_BTNFACE), WindowCanvas(pThis->_htoolbar));
|
hbmp = create_bitmap_from_icon(hIcon, GetSysColorBrush(COLOR_BTNFACE), WindowCanvas(pThis->_htoolbar));
|
||||||
DestroyIcon(hIcon); // some icons can be freed, some not - so ignore any error return of DestroyIcon()
|
if (delete_icon)
|
||||||
|
DestroyIcon(hIcon); // some icons can be freed, some not - so ignore any error return of DestroyIcon()
|
||||||
} else
|
} else
|
||||||
hbmp = 0;
|
hbmp = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue