Select one or more items in a List Box control.
cSetLBItemEX (window-handle, Item-#-list)
(i) window-handle Windows handle to a List Box control.
(s) Item # list Numbers of List Box items to select.
(i) @TRUE, If all listed items were selected.; @FALSE, If one or more listed items were not selected.
This function allows you to select one or more items in a List Box control. It extends the Control Manager function cSetLBItem by allowing interactions with multiple-select list boxes. Multiple-select List Boxes allow the user to highlight more than one item in the list box at a time. You specify the items to select by listing one or more space separated numbers as a string in the second parameter. Each number should correspond to an item in the list starting with 1 as the item at the top of the list.
The function returns an error message, if you pass in more than one item number but the specified List Box does not support multiple-selection. It will also return an error message, if you specify any item numbers greater than the number of items in the list.
The class name for List Box controls is "List Box".
AddExtender("wwctl44i.dll",0,"wwctl64i.dll") ;Get the handle of the parent window of the list box control. hwndParent = DllHwnd("Microsoft Control Spy -") hwnd = cWndbyclass(hwndParent, "ListBox") ; Get all the item text for the list box. AllItems = cGetLbText(hwnd) ; Get a count of the list choices ItemCnt = ItemCount(AllItems, @TAB) ;Create a space delimited list of item numbers NumberList = "" For i = 1 To ItemCnt NumberList = ItemInsert(i, -1, NumberList, " ") Next ; Select all the items in the list If ! cSetLbItemEx(hwnd, NumberList) Goto ErrorHandler EndIf Exit