cGetLBCount

Get a count of items in a List Box control.

Syntax:

cGetLBCount (window-handle)

Parameters:

(i) window-handle window handle to a List Box control.

Returns:

(i) count number of items in List Box

 

Note: Use this function to get a count of items in a List Box control. The function can obtain the count for "Owner Drawn" and non-text item List Boxes, as well as, conventional List Boxes.

 

Example:

AddExtender("wwctl44i.dll",0,"wwctl64i.dll")

hwndParent = DllHwnd("Microsoft Control Spy -") hwnd = cWndbyclass(hwndParent, "ListBox") ; Clear any current selections If !cClearLbAll(hwnd)    Goto ErrorHandler EndIf ; Get the number of items in the List Box. nCount = cGetLbCount(hwnd) ; Select the last item in the list box If ! cSetLbItemEx(hwnd, nCount)    Goto ErrorHandler EndIf ; Get the selected items text SelectedText = cGetLbSelText(hwnd) Message("Last Item’s Text", SelectedText) Exit

See Also:

cGetLBText, cSetLBItem, cGetLBSelText, cSetLBItemEX, cClearLBAll