cSetLVItem

You can use this function to make an item of a List View common control the selected item. Once an item is selected, it is the ultimate recipient of mouse clicks and key strokes sent to the control.

Syntax:

cSetLVItem (window-handle, item)

Parameters:

(i) window-handle Windows handle to a List View common control.

(i) item The one based number of the item to make the selected item,  i.e., the item's location in a list whose first item is item #1.

Returns:

(i)  @TRUE, if is selected.; @FALSE, if item was not selected.

 

The class name for this control is "SysListView32".

 

32-bit Extender

This function is designed for Windows 32-bit application controls. It cannot be used on Windows 64-bit controls.

64-bit Extender

This function is designed for Windows 64-bit application controls. It cannot be used on Windows on 32-bit controls.

 

Example:

AddExtender("wwctl44i.dll",0,"wwctl64i.dll")
; Explorer List View area
hwndex = DllHwnd("Exploring ")
hwnd = cWndbyclass(hwndex,"SHELLDLL_DefView")
hwnd = cWndbyclass(hwnd,"SysListView32")
myitem = "Backup"
; Get the labels from the first column of each row in the control.
wintext = cGetLvText(hwnd)
;Get the index of the item
select1=ItemLocate(myitem, wintext, @TAB)
If select1
   ; Select the item from the list control.
   If cSetLvItem(hwnd, select1)
      cDblClickItem(hwnd, 0)
   Else
      ; Can't select the item
      Message("Item not selected", "Item number %select1% may no longer exist.")
   EndIf
Else
   Message("Item not found", "Item number %select1% may no longer exist.")
EndIf
Exit

See Also:

cGetLVText, cClearLVItem, cDblClickItem, cWndByClass, cWndinfo, DLLhwnd (WIL help).