title: How can I save HICON to an .ico file?
body: <p>I am extracting an icon from .exe/.dll and want to save it in an .ico file. What is the best way to do this?</p>
  
  <p>I have tried to use <code>::OleCreatePictureIndirect()</code> and then <code>IPicture-&gt;SaveAsFile()</code>. It works but transparent parts of the icon are painted black (and obviously are not transparent any more :( ).</p>
  
  <p>I tried manual parsing. It works OK but is cumbersome and I am afraid of complications with Vista icons/.icl files/etc.</p>
  
  <p>Please, help. Thanks.</p>