- load icon resources using LoadImage. ExtractIcon loads sequential numbers, not resource numbers.

- fixes the device image list

svn path=/trunk/; revision=28816
This commit is contained in:
Ged Murphy 2007-09-03 14:51:06 +00:00
parent 21c0efe8cd
commit ce162db686

View file

@ -1449,7 +1449,7 @@ SetupDiGetClassImageListExW(
/* Prepare a HIMAGELIST */ /* Prepare a HIMAGELIST */
InitCommonControls(); InitCommonControls();
ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR, 100, 10); ClassImageListData->ImageList = ImageList_Create(16, 16, ILC_COLOR32, 100, 10);
if (!ClassImageListData->ImageList) if (!ClassImageListData->ImageList)
goto cleanup; goto cleanup;
@ -1464,7 +1464,10 @@ SetupDiGetClassImageListExW(
&hIcon, &hIcon,
NULL); NULL);
if (ret) if (ret)
{
list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon); list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon);
DestroyIcon(hIcon);
}
else else
list->IconIndexes[i] = -1; /* Special value to tell that icon is unavailable */ list->IconIndexes[i] = -1; /* Special value to tell that icon is unavailable */
} }
@ -1612,7 +1615,8 @@ SetupDiLoadClassIcon(
TRACE("Icon index %d, dll name %s\n", iconIndex, debugstr_w(DllName)); TRACE("Icon index %d, dll name %s\n", iconIndex, debugstr_w(DllName));
if (LargeIcon) 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); SetLastError(ERROR_INVALID_INDEX);
goto cleanup; goto cleanup;