#include <GUIConstantsEx.au3>
#include <FileOperations.au3>
#include <TreeViewConstants.au3>
#include <GUITreeView.au3>
#include <WindowsConstants.au3>
Local $aFile=_FO_FileSearch(@ScriptDir,"*.*",True,125,1,2)
Global $item[UBound($aFile)]
$gui = GUICreate("", 498, 437)
$TreeView = GUICtrlCreateTreeView(0, 0, 265, 433,BitOR($tvs_checkboxes,$tvs_hasbuttons))
$hTree=GUICtrlGetHandle($TreeView)
For $i=0 To UBound($aFile)-1
$item[$i]=_GUICtrlTreeView_Add($hTree,0,$aFile[$i],$i)
Next
$Group1 = GUICtrlCreateGroup("Выделенные файлы", 272, 32, 217, 401)
$Edit = GUICtrlCreateEdit("", 280, 48, 201, 377)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GetCheck = GUICtrlCreateButton("Написать отмеченные пункты", 272, 0, 187, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GetCheck
Local $nI=_GUICtrlTreeView_GetCount($hTree),$sStringCh
For $i=0 To $nI-1
If _GUICtrlTreeView_GetChecked($hTree,$item[$i]) Then
$sStringCh&=_GUICtrlTreeView_GetText($hTree,$item[$i])&@CRLF
EndIf
Next
GUICtrlSetData($Edit,'')
GUICtrlSetData($Edit,$sStringCh)
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd