
;Include die benötigte UDF's
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Array.au3>
#include <ListviewConstants.au3>


;Umwandeln der Datei in ein Array
Dim $array
_FileReadToArray("kategorie.dat", $array)


;Array anzeigen
_ArrayDisplay($array, "Der Array")


GUICreate("Kategorie", 220, 300, 200, 250)


$listview = GUICtrlCreateListView("Kategorie 1", 10, 10, 200, 200, $LVS_SORTASCENDING, $LVS_EX_CHECKBOXES)
$button = GUICtrlCreateButton("Auswählen", 75, 250, 70, 20)

For $item = 1 To $array[0]
	$content = GUICtrlCreateListViewItem($array[$item], $listview)

Next

GUISetState()

Do
	$msg = GUIGetMsg()

	Select
		Case $msg = $button

			$uebergabe = GUICtrlRead($listview)
			$uebergabe2 = GUICtrlGetState($listview)

			MsgBox(0, "listview item", $uebergabe, 2)
			MsgBox(0, "listview item", $uebergabe2, 2)
	EndSelect

Until $msg = $GUI_EVENT_CLOSE
Exit

