简体   繁体   中英

how to extract all icons from some exe files and insert them to other exe files using Delphi?

I'm using Delphi. I want to know how to extract (all) the icons from an exe file and insert them into another, preserving the order and the index of the icons. I found some samples of Delphi code using Google but the problem is that it doesn't extract them all. And I've found some compiled programs (exes) that do one or the other but not both. Why do I need this: because I have to start some exe files (that have those icons) from virtualized applications. And I want to make some external exe files that have the same name and the same icons. Thank you for your help.

The source is available for Colin Wilson's XN Resource Editor. It should have what you need. http://www.wilsonc.demon.co.uk/d10resourceeditor.htm

Alternatively you have the Delphi sample 'ResXplor'. If it's not distributed in your version it's also avalaible to download here: http://radstudiodemos.svn.sourceforge.net/viewvc/radstudiodemos/branches/RadStudio_XE/Delphi/VCL/resXplor/

There was a similar question about extracting icons. PrivateExtractIcons gives you access to specific image sizes in an icon resource, but you need to know the sizes ahead of time, and Microsoft warns that this method is not for general use .

There is a working example of extracting the entire icon resource with all of the image sizes on Delphi Praxis. The example has a problem with 256 pixel images, so it would have to be tweaked to account for these.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM