[SETUPAPI]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 5 Oct 2014 08:55:55 +0000 (08:55 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 5 Oct 2014 08:55:55 +0000 (08:55 +0000)
Add overlay icons to the class image list.

svn path=/trunk/; revision=64535

reactos/dll/win32/setupapi/devclass.c

index 446ac91..84b5609 100644 (file)
@@ -486,6 +486,7 @@ SetupDiGetClassImageListExW(
         HICON hIcon;
         DWORD size;
         INT i, bpp;
+        UINT idx;
 
         /* Get list of all class GUIDs in given computer */
         ret = SetupDiBuildClassInfoListExW(
@@ -589,6 +590,19 @@ SetupDiGetClassImageListExW(
                 list->IconIndexes[i] = -1; /* Special value to indicate that the icon is unavailable */
         }
 
+        /* Finally, add the overlay icons to the image list */
+        for (i = 0; i < 2; i++)
+        {
+            hIcon = LoadImage(hInstance, MAKEINTRESOURCE(500 + i), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+            if (hIcon)
+            {
+                idx = ImageList_AddIcon(ClassImageListData->ImageList, hIcon);
+                if (idx != -1)
+                    ImageList_SetOverlayImage(ClassImageListData->ImageList, idx, i);
+                DestroyIcon(hIcon);
+            }
+        }
+
         ret = TRUE;
 
 cleanup: