cGetLvFocText

Retrieve the text associated with the items that have the focus in a List View common control.

Syntax:

cGetLvFocText( window-handle)

Parameters:

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

Returns:

(s) text Text associated with item that has the focus.

Use this function to retrieve the text associated with the items that have the focus in a List View common control. Although more than one item may be selected, only one item can have the focus. The focused item is often surrounded by the standard focus rectangle. This function can return item text even when no item has the focus rectangle. This is because the control has a default item when no items have been selected.

The class name for the List View 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")
; Get My computer's list view.
hwnd = cFindByName("~My Computer")
hwnd = cWndbyclass(hwnd,"SHELLDLL_DefView")
hwnd = cWndbyclass(hwnd,"SysListView32")
; Get the focused item
sFocusText = cGetLvFocText(hwnd)
If StrCmp(sFocusText, "(C:)")
   ; Start a new Explorer window showing the contents of the C drive.
   SendKeysTo("~My Computer", "{ENTER}")
Else
   Message("Focus is not on the C drive ", "It is on %sFocusText%")
EndIf
Exit

See Also:

cGetLvDdtText, cGetLvColText, cGetLVText, cSetLvItem, cClearLvItem, cDblClickItem, cWndByClass, cWndinfo