I need to extract all icons from an EXE and save them as disk files, but I cannot use the simplest solution (ExtractIconEx) because I need to extract the ICO files in a way
Here is a working example on Delphi Praxis. It reads the default RT_GROUP_ICON and associated RT_ICON resources for a specified executable and saves them as as a complete multi-image .ICO file.
It seems to be confused by 256 pixel images (saves with invalid format), at least on XP, so it might need a little tweaking.