The following code lists all files & folders in the current directory. I was thinking of creating a counter, increase it every time a tree view item is added. Then in a for loop, check each item with a IsFolder() function, but there isn't a function that I'm aware of that does that. #include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
Local $frmMain = GUICreate("Tree View", 234, 363, -1, -1)
Local $tMain = GUICtrlCreateTreeView(0, 0, 250, 380)
$hFiles = FileFindFirstFile("*.*")
If $hFiles = -1 Then Exit
While 1
$cFile = FileFindNextFile($hFiles)
If @error Then ExitLoop
GUICtrlCreateTreeViewItem($cFile, $tMain)
WEnd
FileClose($hFiles)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd