I want to create a basic file editor that allows you to edit a few fields from one of a game's creature files (a binary file) then resave that file. Fields editable should be things like hitpoints and resistances. The location for these things (for example offset 0x0024 is a (word) that determines current hit points) are known in the file, and the information's datatype is known also, for example a byte for the resistance values. How do I create an edit window with win api that allows me to read in the original values, then change and save the new values. I can create dialog windows off the main menu but it is a hassle to do one for every thing that needs to be changed, since their are several fields to change.
Below is my code from the resource file which is how I am listing the windows now, but there has to be an easier way. If it is possible, I would like to have several editable windows open at once, with the original creatures stat values displayed in each. Thanks in advance for any help!
Code:
MAINMENU MENU
{
POPUP "&File"
{
MENUITEM "&Open...", CM_FILE_OPEN
MENUITEM "Save &As...", CM_FILE_SAVEAS
MENUITEM "&Clone", CM_FILE_COPY
MENUITEM "&Paste", CM_FILE_PASTE
MENUITEM SEPARATOR
MENUITEM "E&xit", CM_FILE_EXIT
}
POPUP "&Help"
{
MENUITEM "&About", CM_ABOUT
MENUITEM "&Help!", CM_HELP
MENUITEM "&Tutorials", CM_TUTS
}
POPUP "&Edit"
{
MENUITEM "&Max HitPoints", CM_HIT
MENUITEM "&Current HitPoints", CM_CUR_HIT
MENUITEM "&Fire Resistance", CM_FIRE
MENUITEM "&Cold Resistance", CM_COLD
MENUITEM "&Lightning Resistance", CM_LIGHT
MENUITEM "&Magic Resistance", CM_MAGIC
MENUITEM "&Crushing Resistance", CM_CRUSH
MENUITEM "&Slashing Resistance", CM_SLASH
MENUITEM "&Piercing Resistance", CM_PIER
MENUITEM "&First Class", CM_CLASS
MENUITEM "&Second Class", CM_CLASS2
MENUITEM "&Third Class", CM_CLASS3
MENUITEM "&Level in First Class", CM_CLASS1LVL
MENUITEM "&Level in Second Class", CM_CLASS2LVL
MENUITEM "&Level in Third Class", CM_CLASS3LVL
}
POPUP "&Generate"
{
MENUITEM "&Generate random cre stats based on level", CM_GENERA
MENUITEM "&Auto generate for all cre levels up to 20", CM_AUTOGEN
MENUITEM "&Auto generate stats until specified cre level", CM_AUTOGENLEV
MENUITEM "&Auto generate stats, custom defined", CM_INPUTCUSTOM
}
}