User-Defined Buttons

The user-defined button, which has the style BS_USERBUTTON, is the only button that sends WM_COMMAND messages to its parent with these notification codes:

BN_PAINT Button is normal
BN_HILITE Button is being clicked
BN_UNHILITE Clicking is finished
BN_DISABLE Button is disabled

These notification codes indicate that the window must be painted. The parent window is responsible for this painting. It can use the low word of lParam to obtain the window handle of the button, GetClientRect to determine the button's dimensions, and GetDC to get the button's device context in preparation for painting. BTNLOOK doesn't process these notification codes, so only a dotted outline appears when the button has the input focus.