MiniGUI API Reference (MiniGUI-Standalone)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros
Messages of combobox control

Macros

#define CB_GETEDITSEL   0xF140
 Gets the starting and ending character positions of the current selection. More...
 
#define CB_LIMITTEXT   0xF141
 Limits the length of text in the edit control. More...
 
#define CB_SETEDITSEL   0xF142
 Sets the starting and ending character positions of the current selection. More...
 
#define CB_ADDSTRING   0xF143
 Adds a string to the list box of a combo box. More...
 
#define CB_DELETESTRING   0xF144
 Deletes a string in the list box of a combo box. More...
 
#define CB_GETCOUNT   0xF146
 Retreives the number of items in the list box of a combo box. More...
 
#define CB_GETCURSEL   0xF147
 Retreives the index of the currently selected item in the list box. More...
 
#define CB_GETLBTEXT   0xF148
 Retreives the string of an item in the list box. More...
 
#define CB_GETLBTEXTLEN   0xF149
 Gets the string length of an item in the list box. More...
 
#define CB_INSERTSTRING   0xF14A
 Inserts a string to the list box of a combo box. More...
 
#define CB_RESETCONTENT   0xF14B
 Removes all items from the list box and edit control. More...
 
#define CB_FINDSTRING   0xF14C
 Searchs the list box for an item beginning with the characters in a specified string. More...
 
#define CB_SETCURSEL   0xF14E
 Selects a string in the list of a combo box. More...
 
#define CB_GETITEMADDDATA   0xF150
 Retreives the application-supplied 32-bit value associated with the specified item. More...
 
#define CB_SETITEMADDDATA   0xF151
 Sets a 32-bit data value with the specified item. More...
 
#define CB_GETDROPPEDCONTROLRECT   0xF152
 Retreives the screen coordinates of the dropdown list box of a combo box. More...
 
#define CB_SETITEMHEIGHT   0xF153
 Sets the height of all items of the list box in a combo box. More...
 
#define CB_GETITEMHEIGHT   0xF154
 Gets the height of items of the list box in a combo box. More...
 
#define CB_GETDROPPEDSTATE   0xF157
 Determines whether the list box of a combo box is dropped down. More...
 
#define CB_FINDSTRINGEXACT   0xF158
 Searchs the list box for an item that matches the specified string. More...
 
#define CB_SETSPINFORMAT   0xF162
 Sets the format string of value for CBS_AUTOSPIN type. More...
 
#define CB_SETSPINRANGE   0xF163
 Determines the range of the spin box in a combo box. More...
 
#define CB_GETSPINRANGE   0xF164
 Gets the range of the spin box in a combo box. More...
 
#define CB_SETSPINVALUE   0xF165
 Determines the value of the spin box in a combo box. More...
 
#define CB_GETSPINVALUE   0xF166
 Gets the current value of the spin box in a combo box. More...
 
#define CB_SETSPINPACE   0xF167
 Determines the pace and the fast pace of the spin box in a combo box. More...
 
#define CB_GETSPINPACE   0xF168
 Gets the pace and the fast pace of the spin box in a combo box. More...
 
#define CB_SPIN   0xF170
 Spins the value of the spin box or auto spin box. More...
 
#define CB_FASTSPIN   0xF171
 Fast spins the value of the spin box or auto spin box. More...
 
#define CB_SETSTRCMPFUNC   0xF172
 Sets the STRCMP function used to sort items. More...
 
#define CB_GETCHILDREN   0xF173
 Gets the handles to the children of a ComboBox control. More...
 

Detailed Description

Macro Definition Documentation

#define CB_ADDSTRING   0xF143

Adds a string to the list box of a combo box.

An application sends a CB_ADDSTRING message to add a string to the list box of a combo box.

1 CB_ADDSTRING
2 char* string;
3 
4 wParam = 0;
5 lParam = (LPARAM)string;
Parameters
stringPointer to the null-terminated string to be added.
Returns
The index of the new item on success, else the one of the following error codes:
  • CB_ERRSPACE No memory can be allocated for new item.
  • CB_ERR Invalid passed arguments.

Definition at line 321 of file combobox.h.

#define CB_DELETESTRING   0xF144

Deletes a string in the list box of a combo box.

An application sends a CB_DELETESTRING message to delete a string in the list box of a combo box.

1 CB_DELETESTRING
2 int index;
3 
4 wParam = (WPARAM)index;
5 lParam = 0;
Parameters
indexSpecifies the index of the string to delete.
Returns
If succeed, return zero; otherwise CB_ERR.

Definition at line 342 of file combobox.h.

#define CB_FASTSPIN   0xF171

Fast spins the value of the spin box or auto spin box.

1 CB_FASTSPIN
2 
3 int direct
4 
5 wParam = (WPARAM)direct;
6 lParam = 0;
Parameters
directIndicats the direct of the spin. Zero means up, non-zero down.
Returns
Always be CB_OKAY.

Definition at line 843 of file combobox.h.

#define CB_FINDSTRING   0xF14C

Searchs the list box for an item beginning with the characters in a specified string.

An application sends a CB_FINDSTRING message to search the list box for an item beginning with the characters in a specified string.

1 CB_FINDSTRING
2 int indexStart;
3 char* string;
4 
5 wParam = (WPARAM)indexStart;
6 lParam = (LPARAM)string;
Parameters
indexStartIndex of the item preceding the first item to be searched.
stringPointer to the null-terminated string that contains the prefix to search for.
Returns
The index of the matching item or CB_ERR to indicate not found.

Definition at line 498 of file combobox.h.

#define CB_FINDSTRINGEXACT   0xF158

Searchs the list box for an item that matches the specified string.

An application sends a CB_FINDSTRINGEXACT message to search the list box for an item that matches a specified string.

1 CB_FINDSTRINGEXACT
2 int indexStart;
3 char* string;
4 
5 wParam = (WPARAM)indexStart;
6 lParam = (LPARAM)string;
Parameters
indexStartIndex of the item preceding the first item to be searched.
stringPointer to the null-terminated string to search for.
Returns
The index of the matching item; otherwise CB_ERR to indicate not found.

Definition at line 663 of file combobox.h.

#define CB_GETCHILDREN   0xF173

Gets the handles to the children of a ComboBox control.

An application sends a CB_GETCHILDREN message to get the handles to the children of a ComboBox control.

1 CB_GETCHILDREN
2 
3 HWND *wnd_edit, *wnd_listbox;
4 
5 wParam = (WPARAM)wnd_edit;
6 lParam = (LPARAM)wnd_listbox;
Parameters
wnd_editThe buffer saving the handle to the edit box of the ComboBox control.
wnd_listThe buffer saving the handle to the list box of the ComboBox control. If the ComboBox have type of CBS_AUTOSPIN, handle to the list box will be 0.
Returns
Always be CB_OKAY.

Definition at line 900 of file combobox.h.

#define CB_GETCOUNT   0xF146

Retreives the number of items in the list box of a combo box.

An application sends a CB_GETCOUNT message to retreive the number of items in the list box of a combo box.

1 CB_GETCOUNT
2 
3 wParam = 0;
4 lParam = 0;
Returns
The number of items in the list box.

Definition at line 362 of file combobox.h.

#define CB_GETCURSEL   0xF147

Retreives the index of the currently selected item in the list box.

An application sends a CB_GETCURSEL message to retreive the index of the currently selected item in the list box of a combo box.

1 CB_GETCURSEL
2 
3 wParam = 0;
4 lParam = 0;
Returns
The index of currently selected item in the list box if have one; otherwise CB_ERR.

Definition at line 381 of file combobox.h.

#define CB_GETDROPPEDCONTROLRECT   0xF152

Retreives the screen coordinates of the dropdown list box of a combo box.

1 CB_GETDROPPEDCONTROLRECT
2 RECT *rect;
3 
4 wParam = 0;
5 lParam = (LPARAM)rect;
Parameters
rectPointer to the RECT structure used to save the coordinates.

Definition at line 585 of file combobox.h.

#define CB_GETDROPPEDSTATE   0xF157

Determines whether the list box of a combo box is dropped down.

1 CB_GETIDROPSTATE
2 
3 wParam = 0;
4 lParam = 0;
Returns
If the list box is visible, the return value is TRUE; otherwise, it is FALSE.

Definition at line 640 of file combobox.h.

#define CB_GETEDITSEL   0xF140

Gets the starting and ending character positions of the current selection.

An application sends a CB_GETEDITSEL message to get the starting and ending character positions of the current selection in the edit control of a combo box.

1 CB_GETEDITSEL
2 int start;
3 int end;
4 
5 wParam = (WPARAM)&start;
6 lParam = (LPARAM)&end;
Parameters
startPointer to a 32-bit value that receives the starting position of the selection.
endPointer to a 32-bit value that receives the ending position of the selection.
Note
Not implemented yet.

Definition at line 251 of file combobox.h.

#define CB_GETITEMADDDATA   0xF150

Retreives the application-supplied 32-bit value associated with the specified item.

An application sends an CB_GETITEMADDDATA message to retrive the 32-bit data value associated with with an item in the list box of the combo box.

1 CB_GETITEMADDDATA
2 int index;
3 
4 wParam = (WPARAM)index;
5 lParam = 0;
Parameters
indexThe index of the item.
Returns
The 32-bit data value associated with an item on success, otherwise CB_ERR to indicate an error.

Definition at line 543 of file combobox.h.

#define CB_GETITEMHEIGHT   0xF154

Gets the height of items of the list box in a combo box.

1 CB_GETITEMHEIGHT
2 
3 wParam = 0;
4 lParam = 0;
Returns
The height of item in the list box.

Definition at line 621 of file combobox.h.

#define CB_GETLBTEXT   0xF148

Retreives the string of an item in the list box.

An application sends a CB_GETLBTEXT message to retreive the string of a specified item in the list box of a combo box.

1 CB_GETLBTEXT
2 int index;
3 char* string;
4 
5 wParam = (WPARAM)index;
6 lParam = (LPARAM)string;
Parameters
indexThe index of the selected item.
stringPointer to the string buffer.
Returns
One of the following values:
  • CB_OKAY
    Success.
  • CB_ERR
    Invalid item index.

Definition at line 406 of file combobox.h.

#define CB_GETLBTEXTLEN   0xF149

Gets the string length of an item in the list box.

An application sends a CB_GETLBTEXTLEN message to get the string length of a specified item in the list box of a combo box.

1 CB_GETLBTEXTLEN
2 int index;
3 
4 wParam = (WPARAM)index;
5 lParam = 0;
Parameters
indexThe index of the specified item.
Returns
The length of the string on success; otherwise CB_ERR.

Definition at line 427 of file combobox.h.

#define CB_GETSPINPACE   0xF168

Gets the pace and the fast pace of the spin box in a combo box.

1 CB_GETSPINPACE
2 int *spin_pace;
3 int *spin_fastpace;
4 
5 wParam = (WPARAM)spin_pace;
6 lParam = (LPARAM)spin_fastpace;
Parameters
spin_pacePointer to the data to retreive the new pace value of the spin box.
spin_fastpacePointer to the data to retreive the new fast pace value of the spin box.
Returns
Always be CB_OKAY.

Definition at line 805 of file combobox.h.

#define CB_GETSPINRANGE   0xF164

Gets the range of the spin box in a combo box.

1 CB_GETSPINRANGE
2 int *spin_min;
3 int *spin_max;
4 
5 wParam = (WPARAM)spin_min;
6 lParam = (LPARAM)spin_max;
Parameters
spin_minThe minimum value of the spin box.
spin_maxThe maximum value of the spin box.
Returns
Always be CB_OKAY.

Definition at line 732 of file combobox.h.

#define CB_GETSPINVALUE   0xF166

Gets the current value of the spin box in a combo box.

1 CB_GETSPINVALUE
2 
3 wParam = 0;
4 lParam = 0;
Returns
The current value of the spin box.

Definition at line 765 of file combobox.h.

#define CB_INSERTSTRING   0xF14A

Inserts a string to the list box of a combo box.

An application sends a CB_INSERTSTRING message to insert a string to the list box of a combo box. Unlike the CB_ADDSTRING message, the CB_INSERTSTRING message do not cause a list to be sorted.

1 CB_INSERTSTRING
2 int index;
3 char* string;
4 
5 wParam = (WPARAM)index;
6 lParam = (LPARAM)string;
Parameters
indexThe index of the position at which to insert the string.
stringPointer to the null-terminated string to be added.
Returns
The index of the new item on success, else the one of the following error codes:
  • CB_ERRSPACE No memory can be allocated for new item.
  • CB_ERR Invalid passed arguments.

Definition at line 455 of file combobox.h.

#define CB_LIMITTEXT   0xF141

Limits the length of text in the edit control.

An application sends a CB_LIMITTEXT message to limit the length of the text the user may type into the edit control of a combo box.

1 CB_LIMITTEXT
2 int newLimit;
3 
4 wParam = (WPARAM)newLimit;
5 lParam = 0;
Parameters
newLimitSpecifies the maximum number of characters the user can enter.
Returns
The return value is always zero.

Definition at line 272 of file combobox.h.

#define CB_RESETCONTENT   0xF14B

Removes all items from the list box and edit control.

An application sends a CB_RESETCONTENT message remove all items from the list box and edit control of a combo box.

1 CB_RESETCONTENT
2 
3 wParam = 0;
4 lParam = 0;
Returns
Always be zero.

Definition at line 473 of file combobox.h.

#define CB_SETCURSEL   0xF14E

Selects a string in the list of a combo box.

1 CB_SETCURLSEL
2 int index;
3 
4 wParam = (WPARAM)index;
5 lParam = 0;
Parameters
indexThe index of the string to select.
Returns
CB_OKAY on success; otherwise CB_ERR to indicate an invalid index.

Definition at line 518 of file combobox.h.

#define CB_SETEDITSEL   0xF142

Sets the starting and ending character positions of the current selection.

An application sends a CB_SETEDITSEL message to set the starting and ending character positions of the current selection in the edit control of a combo box.

1 CB_SETEDITSEL
2 int start;
3 int end;
4 
5 wParam = (WPARAM)start;
6 lParam = (LPARAM)end;
Parameters
startThe starting position of the selection.
endThe ending position of the selection.
Note
Not implemented yet.

Definition at line 296 of file combobox.h.

#define CB_SETITEMADDDATA   0xF151

Sets a 32-bit data value with the specified item.

An application sends an CB_SETITEMADDDATA message to associate a 32-bit data value specified in the lParam parameter with an item in the list box that is specified in the wParam parameter.

1 CB_SETITEMADDDATA
2 int index;
3 DWORD addData;
4 
5 wParam = (WPARAM)index;
6 lParam = (LPARAM)addData;
Parameters
indexThe index of the specified item.
addDatathe 32-bit data value which will associated with the item.
Returns
One of the following values:
  • CB_OKAY
    Success
  • CB_ERR
    Invalid item index

Definition at line 569 of file combobox.h.

#define CB_SETITEMHEIGHT   0xF153

Sets the height of all items of the list box in a combo box.

An application sends an CB_SETITEMHEIGHT message to set the height of all items of the list box in a combo box.

1 CB_SETITEMHEIGHT
2 int itemHeight;
3 
4 wParam = 0;
5 lParam = (LPARAM)itemHeight;
Parameters
itemHeightNew height of item of the list box.
Returns
The effective height of item of the list box.

Definition at line 606 of file combobox.h.

#define CB_SETSPINFORMAT   0xF162

Sets the format string of value for CBS_AUTOSPIN type.

1 CB_SETSPINFORMAT
2 const char* format;
3 
4 wParam = 0;
5 lParam = (LPARAM)format;
Parameters
formatA format string can be used by sprintf function to format an interger.
Returns
CB_OKAY on success; otherwise CB_ERR.

Definition at line 692 of file combobox.h.

#define CB_SETSPINPACE   0xF167

Determines the pace and the fast pace of the spin box in a combo box.

1 CB_SETSPINPACE
2 int new_pace;
3 int new_fastpace;
4 
5 wParam = (WPARAM)new_pace;
6 lParam = (LPARAM)new_fastpace;
Parameters
new_paceThe new pace value of the spin box.
new_fastpaceThe new fast pace value of the spin box.
Returns
Always be CB_OKAY.

Definition at line 785 of file combobox.h.

#define CB_SETSPINRANGE   0xF163

Determines the range of the spin box in a combo box.

1 CB_SETSPINRANGE
2 int new_min;
3 int new_max;
4 
5 wParam = (WPARAM)new_min;
6 lParam = (LPARAM)new_max;
Parameters
new_minThe new minimum value of the spin box.
new_maxThe new maximum value of the spin box.
Returns
CB_OKAY on success; otherwise CB_ERR to indicate invalid parameters.

Definition at line 712 of file combobox.h.

#define CB_SETSPINVALUE   0xF165

Determines the value of the spin box in a combo box.

1 CB_SETSPINVALUE
2 int new_value;
3 
4 wParam = (WPARAM)new_value;
5 lParam = 0;
Parameters
new_valueThe new value of the spin box.
Returns
CB_OKAY on success; otherwise CB_ERR to indicate invalid parameters.

Definition at line 750 of file combobox.h.

#define CB_SETSTRCMPFUNC   0xF172

Sets the STRCMP function used to sort items.

An application sends a CB_SETSTRCMPFUNC message to set a new STRCMP function to sort items in the combo-box.

Note that you should send this message before adding any item to the combo-box control.

1 static int my_strcmp (const char* s1, const char* s2, size_t n)
2 {
3  ...
4  return 0;
5 }
6 
7 CB_SETSTRCMPFUNC
8 
9 wParam = 0;
10 lParam = (LPARAM) my_strcmp;
Parameters
my_strcmpYour own function to compare two strings.
Returns
One of the following values:
  • CB_OKAY
    Success
  • CB_ERR
    This combobox has no list box or it is not an empty list box.

Definition at line 876 of file combobox.h.

#define CB_SPIN   0xF170

Spins the value of the spin box or auto spin box.

1 CB_SPIN
2 
3 int direct;
4 
5 wParam = (WPARAM)direct;
6 lParam = 0;
Parameters
directIndicats the direct of the spin. Zero means up, non-zero down.
Returns
Always be CB_OKAY.

Definition at line 824 of file combobox.h.