We recommend using Visual Studio 2017

User-Defined Handlers


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 User-Defined Handlers.

The following map entries correspond to the function prototypes.

Map entryFunction prototype
ON_MESSAGE( <message>, <memberFxn> )afx_msg LRESULT memberFxn( WPARAM, LPARAM );
ON_REGISTERED_MESSAGE( <nMessageVariable>, <memberFxn> )afx_msg LRESULT memberFxn( WPARAM, LPARAM );
ON_THREAD_MESSAGE( <message>, <memberFxn> )afx_msg void memberFxn( WPARAM, LPARAM );
ON_REGISTERED_THREAD_MESSAGE( <nMessageVariable>, <memberFxn> )afx_msg void memberFxn( WPARAM, LPARAM );

Message Maps
Handlers for WM_ Messages