Jump to content

Help with treeview and ini file


 Share

Recommended Posts

How do to introduce the name of the programs for ini file sections [Title] in Treeview window.

P.S. I would like to appear if it is written: Adobe = 1 and if is written Adobe = 0 do not appear

Autorun1.au3

This is ini file

CODE
[Programs]

C:\Program Files\Dr.Batcher\Dr_Batch.exe=0

C:\Program Files\(E)lephant\(E)lephant.exe=1

[settings]

AutoStart=1

[Title]

(E)lephant=1

Blaunch=1

Adobe=1

Thanks

Link to comment
Share on other sites

your inifile does not look like a standard inifile...

see the helpfile

you inifile would be better like this

[Programs]
0=C:\Program Files\Dr.Batcher\Dr_Batch.exe|0
1-C:\Program Files\(E)lephant\(E)lephant.exe|1
[Settings]
0=AutoStart|1
[Title]
0=(E)lephant|1
1=Blaunch|1
2=Adobe|1

just to help you get started

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 311, 564, 357, 138, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
$Progress1 = GUICtrlCreateProgress(8, 32, 289, 17)
$TreeView1 = GUICtrlCreateTreeView(16, 56, 169, 489)
;$TreeView1_0 = GUICtrlCreateTreeViewItem("", $TreeView1)
;$TreeView1_1 = GUICtrlCreateTreeViewItem("", $TreeView1)
;$TreeView1_2 = GUICtrlCreateTreeViewItem("", $TreeView1)
$TreeView2 = GUICtrlCreateTreeView(185, 56, 111, 489)
;$TreeView2_0 = GUICtrlCreateTreeViewItem("", $TreeView2)
;$TreeView2_1 = GUICtrlCreateTreeViewItem("", $TreeView2)
;$TreeView2_2 = GUICtrlCreateTreeViewItem("", $TreeView2)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$ProgramArray = IniReadSection(@DesktopDir & "\config.ini","Title")
ConsoleWrite(@error&" Eerror"&@lf) 

 
If Not @error Then
 
   For $i = 1 To $ProgramArray[0][0]
        $ss=StringSplit($ProgramArray[$i][1],"|")
        if $ss[2]=1 Then
        $treeitem = GUICtrlCreateTreeViewItem($ss[1],$TreeView1)
        ;GUICtrlSetState(-1, $GUI_HIDE)
        ;If $ProgramArray[$i][1] = "1" Then
            ;GUICtrlSetState($tree,$GUI_CHECKED)
        EndIf
    Next
    EndIf
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Form1
        Case $Form1
        Case $Form1
        Case $Form1
        Case $TreeView1
        Case $TreeView2
    EndSwitch
WEnd

Not fixed your other probmes.

NOTE changed your path to @desktopdir....... NOTE

Edited by Aceguy
Link to comment
Share on other sites

your inifile does not look like a standard inifile...

see the helpfile

you inifile would be better like this

[Programs]
0=C:\Program Files\Dr.Batcher\Dr_Batch.exe|0
1-C:\Program Files\(E)lephant\(E)lephant.exe|1
[Settings]
0=AutoStart|1
[Title]
0=(E)lephant|1
1=Blaunch|1
2=Adobe|1

just to help you get started

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 311, 564, 357, 138, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
$Progress1 = GUICtrlCreateProgress(8, 32, 289, 17)
$TreeView1 = GUICtrlCreateTreeView(16, 56, 169, 489)
;$TreeView1_0 = GUICtrlCreateTreeViewItem("", $TreeView1)
;$TreeView1_1 = GUICtrlCreateTreeViewItem("", $TreeView1)
;$TreeView1_2 = GUICtrlCreateTreeViewItem("", $TreeView1)
$TreeView2 = GUICtrlCreateTreeView(185, 56, 111, 489)
;$TreeView2_0 = GUICtrlCreateTreeViewItem("", $TreeView2)
;$TreeView2_1 = GUICtrlCreateTreeViewItem("", $TreeView2)
;$TreeView2_2 = GUICtrlCreateTreeViewItem("", $TreeView2)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$ProgramArray = IniReadSection(@DesktopDir & "\config.ini","Title")
ConsoleWrite(@error&" Eerror"&@lf) 

 
If Not @error Then
 
   For $i = 1 To $ProgramArray[0][0]
        $ss=StringSplit($ProgramArray[$i][1],"|")
        if $ss[2]=1 Then
        $treeitem = GUICtrlCreateTreeViewItem($ss[1],$TreeView1)
        ;GUICtrlSetState(-1, $GUI_HIDE)
        ;If $ProgramArray[$i][1] = "1" Then
            ;GUICtrlSetState($tree,$GUI_CHECKED)
        EndIf
    Next
    EndIf
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Form1
        Case $Form1
        Case $Form1
        Case $Form1
        Case $TreeView1
        Case $TreeView2
    EndSwitch
WEnd

Not fixed your other probmes.

NOTE changed your path to @desktopdir....... NOTE

Thanks :) i test it and works. I hope that if i got any questions you help me again

Thanks again

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...