Changing the 'Default' Button in the MechCommander DPK Extractor

The MechCommander DPK Extractor annoyingly has its 'Close' button set as the 'default' i.e. the button which is 'pressed' if you hit return. This can be a pain if you are extracting a number of similarly named missions and are just editing a single character in the filename box and then 'naturally' hit return. You can however change the 'default' button to be the 'Extract' button by following the procedure below.

Many Windows executables use what are called 'resources' to store self contained items such as icons, dialog boxes, message strings etc, separate from the program code. Programmers use utilities called 'resource editors' to modify these 'resources' to change the embedded items. You can use a 'resource editor' yourself to change the default button. There are many professional and shareware resource editors available. I use the excellent 'Restorator' available at http://www.bome.com/Restorator and the instructions below are for using that utility, however any good resource editor should be capable in a similar fashion.

WARNING: The procedure hacks your 'MCXTRACT.EXE' file and I take no responsibility for your undertaking this procedure. Backup this file first in case something goes wrong.

1) Download and install 'Restorator' or some other good resource editor
2) Run the resource editor and open the file 'MCXTRACT.EXE' in your MC game folder
3) The left hand pane (in Restorator anyway) shows a list of resources in the executable such as 'Dialog', 'String' etc
4) Click the '+' sign next to 'Dialog' to expand this branch
5) It should now show a dialog number i.e. 102
6) Click on dialog 102
7) The top right pane should show a representation of the DPK Extractor dialog box
8) Select the 'Viewer' menu (in Restorator) and select 'Edit Mode' (this allows you to modify the dialog)
9) The top right pane should now look like this...

102 DIALOGEX 0, 0, 320, 95, 0
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
EXSTYLE = WS_EX_APPWINDOW
CAPTION "MCXtractor"
FONT 8, "MS Sans Serif", 0, TRUE
{
DEFPUSHBUTTON "Close", 1, 167, 74, 50, 14
EDITTEXT 1000, 47, 7, 207, 14, ES_AUTOHSCROLL
LTEXT "File Name:", -1, 7, 10, 38, 8, 0, WS_EX_RIGHT
PUSHBUTTON "Browse...", 1001, 263, 7, 50, 14
PUSHBUTTON "Extract", 1002, 101, 74, 50, 14
LTEXT "This tool will read MCX Distribution files (.DPK) and extract mission files into the proper location. After extraction, simply start the game and select either the Solo Mission or Multiplayer button to play.", -1, 55, 35, 185, 38
}
etc.....................

10) Edit the seventh line (i.e. DEFPUSHBUTTON "Close", 1, 167, 74, 50, 14) and delete the first three characters i.e. 'DEF'
11) Edit the eleventh line (i.e. PUSHBUTTON "Extract", 1002, 101, 74, 50, 14) and add the three characters 'DEF' at the start, leaving the text now like this...

102 DIALOGEX 0, 0, 320, 95, 0
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
EXSTYLE = WS_EX_APPWINDOW
CAPTION "MCXtractor"
FONT 8, "MS Sans Serif", 0, TRUE
{
PUSHBUTTON "Close", 1, 167, 74, 50, 14
EDITTEXT 1000, 47, 7, 207, 14, ES_AUTOHSCROLL
LTEXT "File Name:", -1, 7, 10, 38, 8, 0, WS_EX_RIGHT
PUSHBUTTON "Browse...", 1001, 263, 7, 50, 14
DEFPUSHBUTTON "Extract", 1002, 101, 74, 50, 14
LTEXT "This tool will read MCX Distribution files (.DPK) and extract mission files into the proper location. After extraction, simply start the game and select either the Solo Mission or Multiplayer button to play.", -1, 55, 35, 185, 38
}
etc.....................

12) Select the 'Viewer/Commit changes' menu item in Restorator
13) Select the 'File/Save As' menu item in Restorator and save the modified executable as say MCXTRACT1.EXE
14) Close Restorator
15) Run the modifed DPK extractor and you should now have the 'Extract' button being the default whilst you are editing the filename box.

Although you are free to do this on your own computer you should not distribute the modified executable as you would infringe copyright.