Modifying resource contents of a running executable
- by mrwoik
All,
I store my application settings in a resource. When my program first loads, I read the specified resource using WinAPI. I then parse the retrieved byte data. This works flawlessly for me.
Now let's say that a user alters a setting in my application. He/she checks a checkbox control. I would like to save the updated setting to my resource. However, it seems that my call to UpdateResource will not work while my application is running. I can't modify my resource data even though it is the same size.
First, is it possible to modify a running image's resource data? Second, if that is not possible, what alternatives do I have for storing settings internally within my application?
NOTE: I must have the settings within my running executable. They cannot be on the harddrive or in the registry. Please don't even suggest that as an option.