Cette page vous a-t-elle été utile ?
Votre avis sur ce contenu est important. N'hésitez pas à nous faire part de vos commentaires.
Vous avez d'autres commentaires ?
1500 caractères restants
ON_MESSAGE
TRY
Collapse the table of content
Expand the table of content

ON_MESSAGE

Indicates which function will handle a user-defined message.


ON_MESSAGE(message, memberFxn )

Parameters

message

The message ID.

memberFxn

The name of the message-handler function to which the message is mapped.

The type of the function must be afx_msg LRESULT (CWnd::*)(WPARAM, LPARAM).

User-defined messages are usually defined in the range WM_USER to 0x7FFF. User-defined messages are any messages that are not standard Windows WM_MESSAGE messages. There should be exactly one ON_MESSAGE macro statement in your message map for every user-defined message that must be mapped to a message-handler function.

NoteNote

In addition to user-defined messages, ON_MESSAGE handles less common Windows messages. For more information, see the Knowledge Base article Q99848.

For more information and examples, see Message Handling and Mapping Topics and User-Defined Handlers

// example for ON_MESSAGE
#define WM_MYMESSAGE (WM_USER + 1)
BEGIN_MESSAGE_MAP( CMyWnd, CMyParentWndClass )
    ON_MESSAGE( WM_MYMESSAGE, OnMyMessage )
    // ... Possibly more entries to handle additional messages
END_MESSAGE_MAP( )

Ajouts de la communauté

AJOUTER
Afficher:
© 2015 Microsoft