Thread: Help with editor windows with win api

  1. #1
    Registered User
    Join Date
    Mar 2003

    Help with editor windows with win api

    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!

     POPUP "&File"
      MENUITEM "&Open...", CM_FILE_OPEN
      MENUITEM "Save &As...", CM_FILE_SAVEAS
     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

  2. #2
    train spotter
    Join Date
    Aug 2001
    near a computer
    I would probably
    use a combo box (or depending on the number and complexity off the settings list box, listview, treeview ect) to list the items,
    an edit to receive the value,
    a static to display the current value
    and a button to decide when the user wants to update the file.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with this
    By tyrantil in forum C Programming
    Replies: 18
    Last Post: 01-30-2005, 04:53 PM
  2. win api literature
    By DMaxJ in forum Windows Programming
    Replies: 5
    Last Post: 04-30-2004, 03:25 PM
  3. Win API wildcard function??
    By Echidna in forum Windows Programming
    Replies: 5
    Last Post: 11-19-2001, 12:16 AM
  4. Win API
    By Marky_Mark in forum Windows Programming
    Replies: 4
    Last Post: 10-23-2001, 12:57 PM
  5. Rich edit control example Win API
    By Echidna in forum Windows Programming
    Replies: 1
    Last Post: 09-17-2001, 02:12 AM