I was playing around with saving icons from a resource file and thought I would post a little demo of how to do it. This demo will save the icon found at index 10 in the shell32.dll file for the purposes of demonstrating how it is done. It will scan a file and index all of the resource names of the icon group resources and then you can specify an index and save it to an ico file. All icons in the group are saved in a single icon file so you get a real representation of the actual icon file and not a single icon. It can be used in conjunction with PickIconDlg to build an icon extraction utility if you like. All code is public domain, except dwordtoascii that is the GoAsm translation of Tim Roberts dwtoa.

The demo is written in GoAsm (easy to translate to MASM) and requires my include files, available at my website.
Posted on 2004-01-10 20:53:14 by donkey
Hi donkey,
Can't you make a SaveIcon proc which takes the DllName, Index, SaveName etc. Then ask Hutch to put it in the MASM32 lib:cool: ;) :tongue: :)

Thomas Antony
Posted on 2004-01-14 04:52:32 by thomasantony
Hi Thomas,

Use the code if you want, you can easily convert it to a one-shot routine but that would be incredibly inefficient, loading the library and indexing the icon groups then extracting and saving the icon every time. It is in it's essence a nearly complete icon extraction utility, I am just not that interested in making that application so you are free to use my code to complete it if you want to. This is not a function for a lib based routine as it is made to be adapted to a specific application.
Posted on 2004-01-14 10:35:50 by donkey
It's possible also to extract icons from .res files as binary data
Posted on 2004-01-14 13:33:51 by Vortex