Here is my function _TreeView_GetAll() which gets whole content of TreeView control, in this case even from external application:
Here you can see how to simply traverse the whole TreeView ...
#Include <String.au3>
#Include <GuiTreeView.au3>
$sAll = _TreeView_GetAll('OLE/COM Object Viewer', '', 'SysTreeView322')
FileDelete('treeview_get_all.txt')
FileWrite('treeview_get_all.txt', $sAll)
;~ClipPut($sAll)
Func _TreeView_GetAll($title, $text, $classNN, $expand = False, $indent = ' ', $bullet = '') ; $bullet = '- '
$hWnd = ControlGetHandle($title, $text, $classNN)
$sAll = ''
If $expand Then _GUICtrlTreeView_Expand($hWnd) ; Expand All
$hItem = _GUICtrlTreeView_GetFirstItem($hWnd)
While $hItem <> 0x00000000
$sItem = _GUICtrlTreeView_GetText($hWnd, $hItem)
$level = _GUICtrlTreeView_Level($hWnd, $hItem)
$sIndent = _StringRepeat($indent, $level)
$sAll &= $sIndent & $bullet & $sItem & @CRLF
$hItem = _GUICtrlTreeView_GetNext($hWnd, $hItem)
WEnd
Return $sAll
EndFunc