title: Find out number of icons in an icon resource using Win32 API
body: <p>I have an <em>*.ico</em> 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 <code>RegisterClassEx()</code>, i.e.:</p>
  
  <pre><code>wcx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
  </code></pre>
  
  <p>In addition to that, I'd also like to convert all the single icons in this resource to <code>ARGB</code> pixel arrays. This should be possible by using <code>GetDIBits()</code> on the bitmap returned by <code>GetIconInfo()</code>.</p>
  
  <p>However, there is one problem: I need to find out the number of icons in the <code>HICON</code> handle returned by <code>LoadIcon()</code> as well as their sizes. I do not seem to find an API that takes a <code>HICON</code> handle and tells me how many icons there are actually in there and what their sizes are. </p>
  
  <p>Is this possible somehow or do I need to go the hard way and parse the <em>*.ico</em> resource myself?</p>