Click to See Complete Forum and Search --> : Updating bitmap resources inside exe or dll
alex_gusev
January 13th, 2003, 12:10 PM
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
Bengi
January 13th, 2003, 02:18 PM
get your self an Resource Editor.
i.e: ResHack
alex_gusev
January 13th, 2003, 04:11 PM
Well, the issue is to do it programmatically instead of using resource editors, e.g. VC++'s resource editor does all job just fine... :)
TheCPUWizard
January 13th, 2003, 04:31 PM
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)...
alex_gusev
January 13th, 2003, 04:39 PM
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...
Bengi
January 14th, 2003, 01:37 AM
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
puzzolino
January 14th, 2003, 02:12 AM
Have a look at these APIs:
BeginUpdateResource
EndUpdateResource
UpdateResource
Sorry, but they work on WinNT/2000/XP only...
alex_gusev
January 14th, 2003, 02:17 AM
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.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.