I want to extract an icon from a Win32 exe/dll or Icon Library (.icl etc.). But, with the ExtractIconEX API, I can only extract one large and one small icon. I want to extract all the icon formats, for example:

16x16 - 16 colors
16x16 - 256 colors
32x32 - 16 color
32x32 - 256 colo
32x32 - Windows XP 24-bit + 8-bit alpha channel
48x48 ... etc.

And save this to a .ICO file.

I got working code for Win32 exe/dll's, but not for icl's. Help!