|
|
Appends the specified string. An application sends an LB_ADDSTRING message to append an item specified in the lParam parameter to a list box. For a text-only list box:
LB_ADDSTRING const char* text; wParam = 0; lParam = (LPARAM)text;
LB_ADDSTRING PLISTBOXITEMINFO plbii; wParam = 0; lParam = (LPARAM)plbii;
|
|
|
Removes an item from the list box. An application sends an LB_DELETESTRING message to a list box to remove from the list box.
LB_DELETESTRING int del; wParam = (WPARAM)del; lParam = 0;
|
|
|
Searchs a specified string. An application sends an LB_FINDSTRING message to search a list box for an item that begins with the characters specified in the lParam parameter. The wParam parameter specifies the zero-based index of the item before the first item to be searched; The lParam parameter specifies a pointer to a null-terminated string that contains the prefix to search for.
LB_FINDSTRING int index; char *string; wParam = (WPARAM)index; lParam = (LPARAM)string;
|
|
|
Searchs for an item that exactly matches the characters specified. An application sends an LB_FINDSTRINGEXACT message to a list box to search it for an item that exactly matches the characters specified in the lParam parameter.
LB_FINDSTRINGEXACT int index; const char *string; wParam = (WPARAM)index; lParam = (LPARAM)string;
|
|
|
Determines the index of the item that has the focus rectangle. An application sends an LB_GETCARETINDEX message to a list box to determine the index of the item that has the focus rectangle in a multiple-selection list box.
LB_GETCARETINDEX wParam = 0; lParam = 0;
|
|
|
Gets check mark status of an item.
LB_GETCHECKMARK int index; wParam = (WPARAM)index; lParam = 0;
|
|
|
Gets the number of items in the list box. An application sends an LB_GETCOUNT message to a list box to get the number of items in the list box.
LB_GETCOUNT wParam = 0; lParam = 0;
|
|
|
Gets the index of the currently selected or highlighted item. An application sends an LB_GETCURSEL message to a list box to get the index of the currently selected item, if there is one, in a single-selection list box. For multiple-selection list box, appliction send an LB_GETCURSEL message to a list box to get the index of the current highlighted item.
LB_GETCURSEL wParam = 0; lParam = 0;
|
|
|
Gets the 32-bit data value associated with an item. An application sends an LB_GETITEMADDDATA message to a list box to get the 32-bit data value the list box has stored for the item with index of wParam; By default this is zero. An application must set the item data value by sending an LB_SETITEMADDDATA message to the list box for this value to have meaning.
LB_GETITEMADDDATA int index; wParam = (WPARAM)index; lParam = 0;
|
|
|
Gets item data in a list box if the box has LBS_CHECKBOX and/or LBS_USEICON styles. An application sends LB_GETITEMDATA message to a list box to retrive the check box flag and the handle of icon. Note that the text of the item will not be returned, i.e., the field of string of LISTBOXITEMINFO structure will be ignored.
LB_GETITEMDATA int index; PLISTBOXITEMINFO plbii; wParam = (WPARAM)index; lParam = (LPARAM)plbii;
|
|
|
Gets the height in pixels of an item specified in the wParam parameter. An application sends an LB_GETITEMHEIGHT message to a list box to get the height in pixels of an item specified in the wParam parameter.
LB_GETITEMHEIGHT wParam = 0; lParam = 0;
|
|
|
Retrieves the dimensions of the rectangle. An application sends an LB_GETITEMRECT message to a list box to retrieve the dimensions of the rectangle that bounds an item as it is currently displayed in the list box window. The item is specified in the wParam parameter, and a pointer to a RECT structure is given in the lParam parameter.
LB_GETITEMRECT int index; RECT *rcItem; wParam = (WPARAM)index; lParam = (LPARAM)rcItem;
|
|
|
Gets the selected state for an specified item. An application sends an LB_GETSEL message to a list box to get the selected state for an item specified in the wParam parameter.
|
|
|
Gets the number of selected items in a multiple-selection list box. An application sends an LB_GETSELCOUNT message to a list box to get the number of selected items in a multiple-selection list box.
LB_GETSELCOUNT wParam = 0; lParam = 0;
|
|
|
Gets the numbers of selected items. An application sends an LB_GETSELITEMS message to a list box to fill a buffer with an array of integers that specify the item numbers of selected items in a multiple-selection list box.
LB_GETSELITEMS int nItem; int *pInt; wParam = (WPARAM)nItem; lParam = (LPARAM)pInt;
|
|
|
Retrieves the text of an item in list box. An application sends an LB_GETTEXT message to a list box to retrieve the text of an item.
LB_GETTEXT int index; char *string; wParam = (WPARAM)index; lParam = (LPARAM)string;
|
|
|
Gets the length of text of item specified in a list box. An application sends an LB_GETTEXTLEN message to a list box to get the length of text of the item specified in the wParam parameter.
LB_GETTEXTLEN int index; wParam = (WPARAM)index; lParam = 0;
|
|
|
Gets the index to the first visible item in the list box. An application sends an LB_GETTOPINDEX message to get the index to the first visible item in the list box. Initially, the first visible item is item 0, but this changes as the list box is scrolled.
LB_GETTOPINDEX wParam = 0; lParam = 0;
|
|
|
Inserts an item to the list box. An application sends an LB_INSERTSTRING message to insert an item into a list box. Unlike LB_ADDSTRING message, the LB_INSERTSTRING message do not cause the list to be sorted. For a text-only list box:
LB_INSERTSTRING const char* text; wParam = index; lParam = (LPARAM)text;
LB_INSERTSTRING int index; PLISTBOXITEMINFO plbii; wParam = (WPARAM)index; lParam = (LPARAM)plbii;
|
|
|
Removes the contents of a list box. An application sends an LB_RESETCONTENT message to remove the all items in a list box.
LB_RESETCONTENT wParam = 0; lParam = 0;
|
|
|
Sets the focus rectangle to the item at the specified index. An application sends an LB_SETCARETINDEX message to set the focus rectangle to the item at the specified index in a multiple-selection list box.
LB_SETCARETINDEX int index; wParam = (WPARAM)index; lParam = 0; |
|
|
Sets check mark status of an item.
LB_SETCHECKMARK int index, status; wParam = (WPARAM)index; lParam = (LPARAM)status;
|
|
|
Selects an item. An application sends an LB_SETCURSEL message to a list box to select an item and scroll it into view, if necessary.
LB_SETCURSEL int cursel; wParam = (WPARAM)cursel; lParam = 0;
|
|
|
Associates a 32-bit data value with an item. An application sends an LB_SETITEMADDDATA message to associate a 32-bit data value specified in the lParam parameter with an item in the list box.
LB_SETITEMADDDATA int index; DWORD addData; wParam = (WPARAM)index; lParam = (LPARAM)addData;
|
|
|
Sets item data in a list box if the box has LBS_CHECKBOX and/or LBS_USEICON styles. An application sends LB_SETITEMDATA message to a list box to set the check box flag and the handle of icon. Note that the text of the item will not be changed, i.e., the field of string of LISTBOXITEMINFO structure will be ignored.
LB_SETITEMDATA int index; PLISTBOXITEMINFO plbii; wParam = (WPARAM)index; lParam = (LPARAM)plbii;
|
|
|
Sets the height of all items. An application sends an LB_SETITEMHEIGHT message to set the height of all items in a list box.
LB_SETITEMHEIGHT int itemHeight; wParam = 0; lParam = (LPARAM)itemHeight;
|
|
|
Selects an item in a multiple-selection list box. An application sends an LB_SETSEL message to select an item in a multiple-selection list box and scroll it into view if necessary.
|
|
|
Sets the STRCMP function used to sort items. An application sends an LB_SETSTRCMPFUNC message to set a new STRCMP function to sort items. Note that you should send this message before adding any item to the list box control.
static int my_strcmp (const char* s1, const char* s2, size_t n) { ... return 0; } LB_SETSTRCMPFUNC wParam = 0; lParam = (LPARAM)my_strcmp;
|
|
|
Sets text of the specified item.
LB_SETTEXT int index; const char *string; wParam = (WPARAM)index; lParam = (LPARAM)string;
|
|
|
Ensures that a particular item in it is visible. An application sends an LB_SETTOPINDEX message to a list box to ensure that a particular item in it is visible. The item is specified in the wParam parameter. The list box scrolls so that either the specified item appears at the top of the list box or the maximum scroll range has been reached.
LB_SETTOPINDEX int index; wParam = (WPARAM)index; lParam = 0;
|
1.4.2