When the user clicks a button, its state changes, and the button sends notification messages to its parent window. For example, a push button control sends the BN_CLICKED notification message whenever the user chooses the button. In all cases (except for BCN_HOTITEMCHANGE), the low-order word of the wParam parameter contains the control identifier, the high-order word of wParam contains the notification code, and the lParam parameter contains the control window handle.
Both the message and the parent window's response depend on the type, style, and current state of the button. Following are the button notification messages an application should monitor and process.
A button sends the BN_DISABLE, BN_PUSHED, BN_KILLFOCUS, BN_PAINT, BN_SETFOCUS, and BN_UNPUSHED notification messages only if it has the BS_NOTIFY style. BN_DBLCLK notification messages are sent automatically for BS_USERBUTTON, BS_RADIOBUTTON, and BS_OWNERDRAW buttons. Other button types send BN_DBLCLK only if they have the BS_NOTIFY style. All buttons send the BN_CLICKED notification message regardless of their button styles.
For automatic buttons, the system changes the push state and paints the button. In this case, the application typically processes only the BN_CLICKED and BN_DBLCLK notification messages. For buttons that are not automatic, the application typically responds to the notification message by sending a message to change the state of the button. For information about sending messages to buttons, see Sending Messages to Buttons.
When the user selects an owner-drawn button, the button sends its parent window a WM_DRAWITEM message containing the identifier of the control to be drawn and information about its dimensions and state.
'''From WINUSER.H''':
#define BN_CLICKED 0
#define BN_PAINT 1
#define BN_HILITE 2
#define BN_PUSHED 2
#define BN_UNHILITE 3
#define BN_UNPUSHED 3
#define BN_DISABLE 4
#define BN_DBLCLK 5
#define BN_DOUBLECLICKED 5
#define BN_SETFOCUS 6
#define BN_KILLFOCUS 7