Compartir a través de


Adding an ATL Message Handler

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Adding an ATL Message Handler.

To add a message handler (a member function that handles Windows messages) to a control, first select the control in the Class View. Then open the Properties window, select the Messages icon, and click the drop-down control in the box opposite the required message. This will add a declaration for the message handler in the control's header file and a skeleton implementation of the handler in the control's .cpp file. It will also add the message map and add an entry for the handler.

Adding a message handler in ATL is similar to adding a message handler to an MFC class. See Adding an MFC Message Handler for more information.

The following conditions apply only to adding an ATL message handler:

  • The message handlers follow the same naming convention as MFC.

  • The new message map entries are added into the main message map. The wizard does not recognize alternate message maps and chaining.

See Also

Implementing a Window