[See Introduction to Controls]
BS_PUSHBUTTON
BS_DEFPUSHBUTTON
BS_CHECKBOX
BS_AUTOCHECKBOX
BS_3STATE
BS_AUTO3STATE
[ See check box example (caption
options). ]
BS_RADIOBUTTON
BS_AUTORADIOBUTTON
BS_GROUPBOX
BS_USERBUTTON
BS_OWNERDRAW
Button styles:
BS_TEXT
BS_LEFTTEXT
BS_RIGHTBUTTON
BS_ICON
BS_BITMAP
BS_LEFT
BS_CENTER
BS_RIGHT
BS_TOP
BS_VCENTER
BS_BOTTOM
BS_PUSHLIKE
BS_MULTILINE
BS_FLAT
BS_NOTIFY
Button messages:
BM_GETCHECK
BM_SETCHECK ; wParam = new check state
BM_GETSTATE
BM_SETSTATE ; wParam = new push state
BM_SETSTYLE ; wParam = new style
lParam = redraw
BM_CLICK ; simulate click
BM_GETIMAGE
BM_SETIMAGE ; lParam = new image handle
Button states:
BST_UNCHECKED
BST_CHECKED
BST_INDETERMINATE
; Button state masks for BM_GETSTATE
; get check state = 3h
BST_PUSHED ; get push/highlight state
BST_FOCUS ; get focus state
Button notification codes:
BN_CLICKED
BN_PAINT
BN_HILITE
BN_PUSHED
BN_UNHILITE
BN_UNPUSHED
BN_DISABLE
BN_DOUBLECLICKED
BN_DBLCLK
BN_SETFOCUS
BN_KILLFOCUS
DWORD IsDlgButtonChecked(HWND Wnd
int ButtonID)
Same as sending BM_GETSTATE. Effectively used when a button
needs to be queried by a handler for another control.
void CheckDlgButton(HWND Wnd
int ButtonID
DWORD
NewState)
Same as sending BM_SETSTATE. Effectively used when a button
needs to be changed by another control handler.
void CheckRadioButton(HWND Wnd
int FirstBtnID
int LastBtnID
int SelectBtnID)
This is a very useful function. Makes several buttons work
together as a "select one" control. The buttons affected have
control IDs in the range from FirstBtnID to LastBtnID. The button
with the SelectBtnID is the one that gets "checked"
and the
others become "unchecked".