Changing application resources with Delphi

I need to change application resources (bitmap and binary data) with Delphi. I understand that there are system functions for this with certain Windows versions, however my application must run on Windows 95 and later.
I'm using Delphi 4 Standard - could anybody provide some code examples or routines?
Any help will be greatly appreciated!

Note: the app will be commercial, however, I'll give full credits to anybody who can really help. That's an incentive, isn't it :)

Comments

  • Hi, sorry, but the UpdateResource() function only works on NT/2000.
    (Don't know about XP). This is for updating your exe resources at
    run-time.

    hth, pritaeas

    : I need to change application resources (bitmap and binary data) with
    : Delphi. I understand that there are system functions for this with
    : certain Windows versions, however my application must run on Windows
    : 95 and later.
  • Thanks, but I already knew that the UpdateResource() only works on NT/2000.
    I need Delphi code which doesn't use system-specific functions - the Resource Hacker utility by Angus Johnsonn works on Win95 and later so this must be possible. (Unfortunately Angus can't be bothered responding to emails so he's no help.)
    Come on programmers, give me a helping hand! :)


  • Hi,
    You could check out the demo/sample that comes along with delphi5 to view resources. Its called Resource Viewer. It uses a class called ExeFile, or something like that. Really interesting hmmmm!!! I haven't tried going too much into detail, but it reads off Raw Binary Information off the file, and converts it into useful comprehendable data. If you get a clear understanding of it, pl. reply back.




    : Thanks, but I already knew that the UpdateResource() only works on NT/2000.
    : I need Delphi code which doesn't use system-specific functions - the Resource Hacker utility by Angus Johnsonn works on Win95 and later so this must be possible. (Unfortunately Angus can't be bothered responding to emails so he's no help.)
    : Come on programmers, give me a helping hand! :)
    :
    :
    :

  • OK ... First, I'm not using delphi5 but delphi4 standard. delphi4 comes with a similar demo/sample for viewing app resources, but lacks an ExeFile class.
    Second, I've got no problems loading and using resources - delphi4 has a neat TResourceStream class which lets me load resources such as bitmaps. However I need a class or routine which loads a resource from an external file and replaces a resource in an application with that file. Kind of complex, that's why I need help!


  • There's an excellent program called 'ExeScope' that does exactly what you want to do. That too is coded in Delphi. It can be used to view and REPLACE any kind of resource that is stored in any executable / dll file. But, unfortunately, its not open-source, nor does the author very helpful (I think). However, if you probe deep into the demo that comes with Delphi, I'm sure you'll figure out how the Raw data is deciphered, and converted into useful information, and then you could probably seek to the beginning of the resource that you want to replace, and overwrite the original data with your own data. The bitmap, or icon, etc... is stored in exactly the same form as it is in a normal .bmp, or .ico, etc... file. You just have to find out where in the executable its stored.




    : OK ... First, I'm not using delphi5 but delphi4 standard. delphi4 comes with a similar demo/sample for viewing app resources, but lacks an ExeFile class.
    : Second, I've got no problems loading and using resources - delphi4 has a neat TResourceStream class which lets me load resources such as bitmaps. However I need a class or routine which loads a resource from an external file and replaces a resource in an application with that file. Kind of complex, that's why I need help!
    :
    :
    :

  • : There's an excellent program called 'ExeScope' that does exactly what you want to do. That too is coded in Delphi. It can be used to view and REPLACE any kind of resource that is stored in any executable / dll file. But, unfortunately, its not open-source, nor does the author very helpful (I think). However, if you probe deep into the demo that comes with Delphi, I'm sure you'll figure out how the Raw data is deciphered, and converted into useful information, and then you could probably seek to the beginning of the resource that you want to replace, and overwrite the original data with your own data. The bitmap, or icon, etc... is stored in exactly the same form as it is in a normal .bmp, or .ico, etc... file. You just have to find out where in the executable its stored.
    :
    :
    :
    :
    : : OK ... First, I'm not using delphi5 but delphi4 standard. delphi4 comes with a similar demo/sample for viewing app resources, but lacks an ExeFile class.
    : : Second, I've got no problems loading and using resources - delphi4 has a neat TResourceStream class which lets me load resources such as bitmaps. However I need a class or routine which loads a resource from an external file and replaces a resource in an application with that file. Kind of complex, that's why I need help!
    : :
    : :
    : :
    :
    : I'm writing on a same project as you're and trust me without MSDN you won't get very far. try to search (where ever you want but i recommend MSDN) for Pe executable file format. The last thing, there is no standard class in delphi4,5,6 and there probably never will be one, that does what you need. My implementation is over 3000 lines long(just resource handling, loading&saving) so you better start searching for any info you get. I can and will help you if you want but I won't send you any source code. Bye

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