Game Development Reference
Dialog boxes are easily handled by adding event handlers using class
The dialog in Figure B.3 contains five added controls. You can access
the IDs of the controls by right clicking on the control and selecting
'Properties' from the pop-up menu. Working from left to right, the ID of the
controls are IDC_NUM1, IDC_STATIC, IDC_NUM2, IDC_STATIC and
IDC_NUM3. Notice here that more than one control has the ID, IDC_
STATIC. To connect a variable to a control you can use Class Wizard.
Figure B.4 Using Class Wizard to connect a variable to a control.
Select the Member Variables tab and highlight the control ID that you
wish to be attached to a variable. Click the 'Add Variable' button.
Set the variable name and type and press OK in the new dialog box.
Now select the message map tab to connect a function to an event. In
this case we will react to any change to the IDC_NUM1 control by
selecting this from the Object IDs. In the Messages list you will see an
EN_CHANGE message. Select this and click 'Add Function'.
In the new dialog box, give the function a name or select the default
name. Now whenever a change to the text in the control with the ID IDC_