biloon
biloon

Reputation: 435

How do I add custom windows' resources into executable without resource compiler?

I was able to load a bitmap object (LoadImage) into executable (and implement it as an icon); however, when I release it as a standalone executable, the icon disappears. I found out that it requires the bitmap to be present in directory at runtime for this trick to work. However, my executable desktop icon will not change from default icon even with the bitmap present in current directory. I assume that this happens, because desktop icon should be determined during compiling time. Therefore, I want to know if there's a way to add resources into executable without the need of resource compiler? My desire is to have everything done with winapi. If that's not possible, then I'll consider alternatives.

Upvotes: 2

Views: 341

Answers (1)

Adam Rosenfield
Adam Rosenfield

Reputation: 400622

You could use BeginUpdateResource, UpdateResource, and EndUpdateResource to add the bitmap resource to your executable as post-build step or something, but why avoid using the resource compiler? It's really much easier, more straightforward, and future-proof than hacking your own solution.

Upvotes: 2

Related Questions