次の方法で共有


Adding a Message Handler

OverviewHow Do I

You can use ClassView, WizardBar, or ClassWizard to add a message handler (a member function that handles Windows messages) to a class, and map Windows messages to the message handler. You can also quickly add a message handler for any dialog box control.

ClassWizard and WizardBar let you browse the messages associated with user-interface objects in your project. Both tools automatically update the message-dispatch table, or message map, and your class header file when you use them to define message-handling functions.

Note   Adding a message handler to an ATL class is performed in the same way that you add a message handler to an MFC class, however some results may vary. For more information, see the topic

What do you want to know more about?

Mapping messages to functions

What do you want to do?

Add a message handler with ClassView or WizardBar

Add a message handler with ClassWizard

Quickly add a message handler for a control

See Also   Adding a Class, Adding a Member Function, Adding a Member Variable, Overriding a Virtual Function, Deleting a Member Function, Navigating the Class Structure