Home | Overview | How Do I | Tutorial
Note This article applies only to dialog button controls within an MFC project. ATL projects should use the New Windows Messages and Event Handlers dialog box.
To define a message handler for a dialog button, you can use the following convenient shortcut to bypass some intermediate steps.
To define a message handler for a dialog box button
ClassWizard automatically creates a message handler in the class associated with the dialog box. The message handler is named according to the control ID of the dialog box button. Finally, the insertion point moves to the newly created function in your source code.
-or-
If a class is already associated with the dialog box, the Add Member Function dialog box opens if no message handler for the control is implemented yet. If a message handler for the control is already implemented, you navigate directly to that handler's definition.