Remote TreeView

Functions for working with remote TreeView controls

This is set of function to work with TreeViews controled by third party process.  This process requires some data to be injected into remote process address space thus this library depends on Remote Buffer module.

Summary
Functions for working with remote TreeView controls
Initialization function
Find the drive item in “My Computer” branch
Set the location of selected item in the TreeView hierarchy
Select item
Expand item
Find child by its text.
Get the text of the item with given handle

Initialise

TV_Initialise(hwParent,
hwTV)

Initialization function

Parameters

hwParentHWND of the window containing TreeView
hwTVHWND of the TreeView

Remarks

All other functions will operate upon those two HWND’s

FindDrive

TV_FindDrive(drive)

Find the drive item in “My Computer” branch

Parameters

driveDrive letter to find

Returns

Handle to the item that display’s drive letter

Remarks

This is specific to Explorer’s TreeView and ther system windows wich use the same presentation of file system hierarchy (like Browse For Folders standard dialog and similar).

SetPath

TV_SetPath(path)

Set the location of selected item in the TreeView hierarchy

Parameters

pathpath to set

Returns

true on success false on failure

Remarks

Path is not the file system path.  If remote TreeView item has N ancestors Pi, its path will be TP1\TP2\TP3...\TPN\Titem, where TP signifies text of the item P

Select

TV_Select(item)

Select item

Expand

TV_Expand(item,  
waitTime = 50)

Expand item

Parameters

itemItem to be expanded
waitTimeTime to wait for expansion, by default 50ms

FindChild

TV_FindChild(p_start,  
p_txt,  
p_mode = )

Find child by its text.  Start searching from the given item

Parameters

p_startStart searching from this item
p_txtText to search for
p_modeItem’s text contains (1) or is equal (0) to the given text

Returns

Item handle or zero if no item is found

GetTxt

TV_GetTxt(item)

Get the text of the item with given handle

Parameters

itemHandle of the item which text is to be returned

Returns

Item’s text

About

TV_Initialise(hwParent,
hwTV)
Initialization function
TV_FindDrive(drive)
Find the drive item in “My Computer” branch
TV_SetPath(path)
Set the location of selected item in the TreeView hierarchy
TV_Select(item)
Select item
TV_Expand(item,  
waitTime = 50)
Expand item
TV_FindChild(p_start,  
p_txt,  
p_mode = )
Find child by its text.
TV_GetTxt(item)
Get the text of the item with given handle