Create a single HICON if the small and big icon images are the same

This commit is contained in:
Ioannis Tsakpinis 2015-09-07 16:04:27 +03:00
parent 9323778a15
commit 1b51ef3d0e

View File

@ -1040,14 +1040,15 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
void _glfwPlatformSetWindowIcons(_GLFWwindow* window, GLFWimage* icons, int count)
{
GLFWimage* normalicon;
GLFWimage* smallicon;
GLFWimage* imgBig;
GLFWimage* imgSmall;
normalicon = bestFit(icons, count, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
smallicon = bestFit(icons, count, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
imgBig = bestFit(icons, count, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
imgSmall = bestFit(icons, count, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
SendMessage(window->win32.handle, WM_SETICON, ICON_BIG, (LPARAM) createIcon(normalicon));
SendMessage(window->win32.handle, WM_SETICON, ICON_SMALL, (LPARAM) createIcon(smallicon));
HICON icon = createIcon(imgBig);
SendMessage(window->win32.handle, WM_SETICON, ICON_BIG, (LPARAM) icon);
SendMessage(window->win32.handle, WM_SETICON, ICON_SMALL, (LPARAM) (imgSmall == imgBig ? icon : createIcon(imgSmall)));
}
void _glfwPlatformIconifyWindow(_GLFWwindow* window)