The following controls are considered a common controls:
Buttons (WNDCLASS - "BUTTON", MFC Class - CButton) - Represent a button which you can push/check by clicking/using keyboard
List boxes (WNDCLASS - "LISTBOX", MFC Class - CListBox) - Represents a list of items, which can be selected by mouse or keyboard
Edit controls (WNDCLASS - "EDIT", MFC Class - CEdit) - Represents an input box in which you can insert and edit text
Combo boxes (WNDCLASS - "COMBOBOX", MFC Class - CComboBox) - Represents a control which is a list, but in the same time allows you to type and edit your own values
Scroll bars (WNDCLASS - "SCROLLBAR", MFC Class - CScrollBar) - Vertical or horizontal bar which is helpful for scrolling contents in windows.
Static controls (WNDCLASS - "STATIC", MFC Class - CStatic) - Represents a static label
Buttons are controls, which is most cases are used in the following ways:
As push buttons - a button on a window or dialog box, which can be pushed by mouse or by using keyboard. Pushing the button will trigger some action. NOTE: Although buttons from toolbars (like in MS Word) have the same functionality, there is a quite different handling behind the scenes. What you find in this section applies to standalone push buttons, not buttons in the toolbar.
As radio buttons - a group of buttons, from which only one can be selected in a moment
As checkbox - A small square, which can be checked or unchecked
As group box - used for printing frames around a group of other controls
Win32::GuiTest provides the following functions for dealing with buttons:
Sends a BM_SETCHECK message to set the check state of a radio button or check box.
Retrieves the state of the button. Returns TRUE if button checked, FALSE otherwise.
Retrieves the state of the button. Returns TRUE if button grayed, FALSE otherwise.
Pushes a button on the foreground window. Equivalent to PushChildButton( GetForegroundWindow(), $button, $delay ).
Allows generating a mouse click on a particular button.
Allows generating a mouse click on a particular button. Only control id can be given as parameter.
List boxes are controls which allows you to chose item from the list.
Win32::GuiTest provides the following functions for dealing with list boxes:
Returns a list of all items stored in the list box.
Returns an item, which has a given ordinal number
Combo boxes are controls which combine the features of list box and edit field. They allow choosing items from the list but in the same time they allow editing.
Win32::GuiTest provides the following functions for dealing with combo boxes:
Returns a list of all items stored in the ComboBox.
Returns an item, which has a given ordinal number
Select a string in the list of a combo box based off an index (zero-based).
Selects an item in the combo box based off text (case insensitive). Does not make combo box to send CBN_SELCHANGE notification.
Selects an item in the combo box based off text (case insensitive). Makes combo box to send CBN_SELCHANGE notification.