目前做出来后总是一层包含一层,没办法做到同等级的键值创建同等级的分类。guicreate("treeview",300,300)
$htv=guictrlcreatetreeview(0,0,300,300)
guisetstate()
readinfo("data.ini",$htv)
do
sleep(10)
until guigetmsg()=-3
func readinfo($ini,$htv,$csname="class",$hClass=0)
if not $hClass then $hClass=$htv
$aSec=inireadsection($ini,$csname)
if @error then return false
for $i=1 to $aSec[0][0]
$child=inireadsection($ini,$aSec[$i][0])
if @error then;频道
$hItem=guictrlcreatetreeviewitem($aSec[$i][0],$hClass)
else;子类
$hClass=guictrlcreatetreeviewitem($aSec[$i][0],$hClass)
readinfo($ini,$htv,$aSec[$i][0],$hClass)
endif;频道或分类
next
return true
endfunc;readinfo
|