Find out number of icons in an icon resource using Win32 API

Viewed 3197

I have an *.ico file that contains multiple icons in different sizes linked to my executable as a resource. I use this resource to set my application's icon with RegisterClassEx(), i.e.:

wcx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));

In addition to that, I'd also like to convert all the single icons in this resource to ARGB pixel arrays. This should be possible by using GetDIBits() on the bitmap returned by GetIconInfo().

However, there is one problem: I need to find out the number of icons in the HICON handle returned by LoadIcon() as well as their sizes. I do not seem to find an API that takes a HICON handle and tells me how many icons there are actually in there and what their sizes are.

Is this possible somehow or do I need to go the hard way and parse the *.ico resource myself?

1 Answers
Related