A button is a control the user can click to provide input to an application. usually the input is a command action.
A push button is a rectangle containing application-defined text (label), an icon, or a bitmap that indicates what the button does when the user selects it. A push button can be one of two styles: standard or default, as defined by the constants BS_PUSHBUTTON and BS_DEFPUSHBUTTON. A standard push button is typically used to start an operation. It receives the keyboard focus when the user clicks it. A default push button, on the other hand, is typically used to indicate the most common or default choice. It is a button that the user can select by simply pressing ENTER when a dialog box has the input focus.
When the user clicks a push button (of either style), it receives the keyboard focus. The system sends the button's parent window a WM_COMMAND message that contains the BN_CLICKED notification code. In response, the dialog box typically closes and carries out the operation indicated by the button.
For more information about buttons please see their reference.
Styles
Buttons have several styles. The type can be either standard or "Default". When a "Default" type of button is choosen, the dialog box will be closed when the user clicks on that button. This is generally the style used for the "Ok" button.
A button can be "owner draw" too, meaning that you draw the button with your own drawing functions. Windows defines an interface with several messages that you should catch to draw the button.
Retrieves the handle of the image associated with the button (bitmap or icon). The parameter should either IMAGE_BITMAP or IMAGE_ICON. Other values will provoke an undefined result.
Example:
ST_BUTTON *button;
...
HANDLE h = button->GetImage(IMAGE_BITMAP);
Retrieves the handle of the bitmap associated with the button (bitmap or icon).
Example:
ST_BUTTON *button;
...
HANDLE h = button->GetBitmap();
The return value of GetState specifies the current state of the button. You can use the following values to extract information about the state. For a full description see the button state values table.
The argument of SetState must be one of the values in the table of button state values.
Example:
ST_BUTTON *button;
...
HANDLE h = button->GetClick();
This will simulate a click on the button.
Example:
ST_BUTTON *button;
...
HANDLE h = button->Click();