8.3.1 Receiving User Input

As the user interacts with the control, the control sends information about the interaction, in the form of a notification message, to the parent window. A notification message is a WM_COMMAND message in which the wParam parameter contains the control identifier and the lParam parameter contains the notification code and the control handle.

For example, when the user clicks a button, the button sends a WM_COMMAND message to the window procedure of the parent window. The WM_COMMAND message's wParam parameter contains the button's control identifier; the high-order word of the message's lParam parameter contains the notification code BN_CLICKED, which indicates that the user has clicked the button.

Since a notification message has the same basic form as menu input, you process notification messages much as you would menu input. If you have carefully selected control identifiers so that they do not conflict with menu identifiers, you can process notification messages in the same switch statement you use to process menu input.