CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2003
    Location
    Cambridge, UK
    Posts
    752

    Updating bitmap resources inside exe or dll

    Hi all,

    I need to replace bitmap resources in my executable without recompilation, so I'd like to know RT_BITMAP resource type structure.

    Any info will be appreciated
    Cheers,

    Alex
    Please rate this post if you find it helpful

  2. #2
    Join Date
    May 2002
    Location
    Somewhere over the rainbow
    Posts
    423
    get your self an Resource Editor.
    i.e: ResHack
    Bengi

  3. #3
    Join Date
    Jan 2003
    Location
    Cambridge, UK
    Posts
    752
    Well, the issue is to do it programmatically instead of using resource editors, e.g. VC++'s resource editor does all job just fine...
    Cheers,

    Alex
    Please rate this post if you find it helpful

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125
    What Bengi is referring to are Resource Editors that update the resources within an executable, which is what you originally asked for...

    Are you instead asking how do do it via API calls, etc.. This would only be necessary if you were going to be performing some type of automatic calculations and then saving the results in the executables resources (which should not be running at that time)...
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  5. #5
    Join Date
    Jan 2003
    Location
    Cambridge, UK
    Posts
    752
    OK, maybe I wasn't formulating my task clear enough.
    I actually need to find some description of how RT_BITMAP resource is saved inside the executable. And I should provide such bitmap replacement via API calls for sure. With dialogs, menus, string tables etc. there are no problems, but I did not see any info about bitmaps/icons. So, that's the question...
    Cheers,

    Alex
    Please rate this post if you find it helpful

  6. #6
    Join Date
    May 2002
    Location
    Somewhere over the rainbow
    Posts
    423
    if you want to Edit your resource programmatically,
    Than you will have to lwarn the Pe header from A - Z and backward :-)
    the PE header contains all the info that there is on the EXE.
    once u have a good grosehold on it, u will be able to write ur own PE editor and from there a resource editor.
    a good PE information is by reading :
    http://spiff.tripnet.se/~iczelion/files/pe-tuts.zip
    Bengi

  7. #7
    Join Date
    Oct 2002
    Location
    Italy
    Posts
    324
    Have a look at these APIs:
    BeginUpdateResource
    EndUpdateResource
    UpdateResource

    Sorry, but they work on WinNT/2000/XP only...

  8. #8
    Join Date
    Jan 2003
    Location
    Cambridge, UK
    Posts
    752
    Thanks to all for responses.

    Exactly UpdateResource function I'm using for all standard resource types except bitmaps and icons. There are 2 parameters

    LPVOID lpData, // resource data
    DWORD cbData // length of resource data

    which structure I need to know in case of RT_BITMAP.
    Cheers,

    Alex
    Please rate this post if you find it helpful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured