cGetTVItem

Obtain the select item of a Tree View common control.

Syntax:

cGetTVItem (window-handle)

Parameters:

(i) window-handle Windows handle To a Tree View common control.

Returns:

(s) TAB-delimited-list List of node text from top of tree hierarchy To selected node.

 

This function is used to obtain the selected item of a Tree View common control. The selected item is the recipient of mouse clicks and keystrokes sent to the control. It is usually characterized by having the system selection color, as the item’s text background color.

The functions return STRING contains the text of an item and each of its ancestor items starting at the root node of the control and proceeding downward to the selected item. A TAB character delimits each item’s text. If no item is selected, the function returns a blank string.

The class name for this control is "SysTreeView32".

 

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")

hwnd = DllHwnd("Exploring") hwnd = cWndbyclass(hwnd, "BaseBar") hwnd = cWndbyclass(hwnd, "ReBarWindow32") hwnd = cWndbyclass(hwnd,"SysTreeView32") ; Path to the item (note the space before "(C)") selection = "Desktop%@TAB%My Computer%@TAB% (C:)" ; Get the currently selected item. selection = cGetTVItem(hwnd) If StrLen(selection) > 0   ; Display all nodes down to the selected item.    selection = StrReplace(selection,@TAB, @CRLF)    Message("Selected Explorer Tree Item", selection) Else   ; No treeview item is selected.     Message("Selected Explorer Tree Item", "No item selected.") EndIf Exit

See Also:

cSetTvItem, cClearTVItem, cDblClickItem, cWndByClass, cWndinfo, DLLhwnd (WIL help).