tags:

views:

272

answers:

1

I've got an HIMAGELIST (from SetupDiGetClassImageList) and I'd like to use it with a Windows Forms ListView, which needs an ImageList. There's no ImageList.FromHandle.

How do I use my HIMAGELIST as an ImageList?

A: 

Not possible but you can use SetupDiLoadClassIcon instead

Shay Erlichmen
Actually, it looks like it is possible, by copying the icons (ImageList_GetIcon) from one to the other. I couldn't get the colour depth and mask working in the half an hour I had...
Roger Lipscombe
You ask how to (re)use the handle, not how to copy the data from one to the other.
Shay Erlichmen
Reading it again, I guess I did ask that. What I meant was: I've got an HIMAGELIST; how do I get an ImageList with the same images in it? Hey ho. Moving on.
Roger Lipscombe