﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
495	_GUICtrlTreeView_GetTree returns only 1 parent	anonymous	Gary	"_GUICtrlTreeView_GetTree sould return the whole treeview-structure for an item, but it returns just the first parent: PARENT|ITEM
This happen, because the line
        Until $hItem <> 0x00000000
should be
        Until $hItem = 0x00000000

The corrected function:
{{{
; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlTreeView_GetTree
; Description ...: Retrieve all items text
; Syntax.........: _GUICtrlTreeView_GetTree($hWnd, $hItem)
; Parameters ....: $hWnd  - Handle to the control
;                  $hItem - item ID/handle
; Return values .: Success      - Tree Path of Item
;                  Failure      - Empty string
; Author ........: Gary Frost (gafrost), Holger Kotsch
; Modified.......: Gary Frost (gafrost)
; Remarks .......: Use Opt(""GUIDataSeparatorChar"", param) to change the separator char used
;                  If $hItem is 0 then an attempt to use current selected is used
; Related .......:
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================
Func _GUICtrlTreeView_GetTree($hWnd, $hItem = 0)
    If $Debug_TV Then _GUICtrlTreeView_ValidateClassName($hWnd)
    If $hItem = 0 Then
        $hItem = 0x00000000
    Else
        If Not IsHWnd($hItem) Then $hItem = _GUICtrlTreeView_GetItemHandle($hWnd, $hItem)
    EndIf
    If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
    
    Local $szPath = """", $hParent, $sSeparator = Opt(""GUIDataSeparatorChar"")

    If $hItem = 0x00000000 Then $hItem = _SendMessage($hWnd, $TVM_GETNEXTITEM, $TVGN_CARET, 0, 0, ""wparam"", ""hwnd"", ""hwnd"")
    If $hItem <> 0x00000000 Then
        $szPath = _GUICtrlTreeView_GetText($hWnd, $hItem)
        
        Do; Get now the parent item handle if there is one
            $hParent = _SendMessage($hWnd, $TVM_GETNEXTITEM, $TVGN_PARENT, $hItem, 0, ""wparam"", ""hwnd"", ""hwnd"")
            If $hParent <> 0x00000000 Then $szPath = _GUICtrlTreeView_GetText($hWnd, $hParent) & $sSeparator & $szPath
            $hItem = $hParent
        Until $hItem = 0x00000000
    EndIf
    
    Return $szPath
EndFunc   ;==>_GUICtrlTreeView_GetTree
}}}"	Bug	closed	3.2.13.8	Standard UDFs	3.2.12.1	None	Fixed		
