Author: gedmurphy Date: Mon Sep 3 18:51:06 2007 New Revision: 28816
URL: http://svn.reactos.org/svn/reactos?rev=28816&view=rev Log: - load icon resources using LoadImage. ExtractIcon loads sequential numbers, not resource numbers. - fixes the device image list
Modified: trunk/reactos/dll/win32/setupapi/devclass.c
Modified: trunk/reactos/dll/win32/setupapi/devclass.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devclass... ============================================================================== --- trunk/reactos/dll/win32/setupapi/devclass.c (original) +++ trunk/reactos/dll/win32/setupapi/devclass.c Mon Sep 3 18:51:06 2007 @@ -1449,7 +1449,7 @@
/* Prepare a HIMAGELIST */ InitCommonControls(); - ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR, 100, 10); + ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR32, 100, 10); if (!ClassImageListData->ImageList) goto cleanup;
@@ -1464,7 +1464,10 @@ &hIcon, NULL); if (ret) + { list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon); + DestroyIcon(hIcon); + } else list->IconIndexes[i] = -1; /* Special value to tell that icon is unavailable */ } @@ -1612,7 +1615,8 @@ TRACE("Icon index %d, dll name %s\n", iconIndex, debugstr_w(DllName)); if (LargeIcon) { - if (1 != ExtractIconEx(DllName, iconIndex, LargeIcon, NULL, 1)) + *LargeIcon = LoadImage(hInstance, MAKEINTRESOURCE(iconIndex), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + if (!*LargeIcon) { SetLastError(ERROR_INVALID_INDEX); goto cleanup;