Hallo Zusammen,
folgendes Problemchen: Ich möchte aus einer INI-Datei die "SectionNames" in ein ListView kriegen.
Das Bispielscript mit MsgBox funzt ja wunderbar:
$var = IniReadSectionNames(@WindowsDir & "\win.ini")
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $var[0]
MsgBox(4096, "", $var[$i])
Next
EndIf
Die "SectionNames" werden alle so wie ich sie haben will ausgelesen und in der MsgBox angezeigt.
Nu wenn ich statt der MsgBox ein GUICtrlCreateListView erstelle dann wird leider nichts ausgelesen:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 317, 254, 192, 124)
$var=IniReadSectionNames(@ScriptDir&"\env.ini")
$ListView1 = GUICtrlCreateListView("", 16, 40, 113, 149)
$Button1 = GUICtrlCreateButton("Start", 64, 200, 241, 41)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $nMsg =$Button1
read()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func Read()
GUICtrlSetData($ListView1, $var)
EndFunc
Mein INI-File schaut so aus:
[Sec1]
wert1 =
wert2=
[Sec2]
wert1 =
wert2=
[Sec3]
wert1 =
wert2=
Wo ist mein Denkfehler? Verzeiht mir meine unwissenheit, bin sehr frisch in der Autoit Welt.
Vielen Dank schon mal
XenYx