Need help with extracting resources from .exes

Hello,

I have a MFC dialog app and I want to be able to extract icons from other .exes and use them in my program.

My plan was this:
1. Use LoadLibrary to load the target .exe
2. Use FindResource and LoadResource to locate and load the dialog box resource.
3. Use LockResource function to retrieve a pointer to resource data
4. Use UpdateResource to update my apps resources

However, I have a problem. FindResource requires requires the name of the resource (or integer id) that I am looking for, but I do not know it.

How can I find out the id(s) of an .exes icon(s)?

Any help is greatly appreciated.
-Flack

Comments

  • : Hello,
    :
    : I have a MFC dialog app and I want to be able to extract icons from other .exes and use them in my program.
    :
    : My plan was this:
    : 1. Use LoadLibrary to load the target .exe
    : 2. Use FindResource and LoadResource to locate and load the dialog box resource.
    : 3. Use LockResource function to retrieve a pointer to resource data
    : 4. Use UpdateResource to update my apps resources
    :
    : However, I have a problem. FindResource requires requires the name of the resource (or integer id) that I am looking for, but I do not know it.
    :
    : How can I find out the id(s) of an .exes icon(s)?
    :
    : Any help is greatly appreciated.
    : -Flack
    :
    [blue]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/introductiontoresources/resourcereference/resourcefunctions/enumresourcenames.asp[/blue]
  • Try the following:

    Just open the file using the Visual C++ Developer Studio. In the Files of Type section, select Executable Files and in the Open as section, select Resources.
    All the resources (Bitmaps, Icons, String Table and Version) will be listed and can be easily copied.

    Have fun!
    Anita.


  • use MAKEINTRESOURCE macro in the Name of Resource when you call the FindResource() function
    Example :
    FindResource(hModule,MAKEINTRESOURCE(1),"Binary");

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories