Jump to content
Sign in to follow this  
YOUF

INI FILE's key How can display in GUICtrlCreateListViewItem »

Recommended Posts

YOUF

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <ListViewConstants.au3>

#include <WindowsConstants.au3>

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

$Form1 = GUICreate("from1", 324, 546, 508, 164)

$ListView1 = GUICtrlCreateListView("all:", 32, 56, 257, 433)

$Button1 = GUICtrlCreateButton("list", 112, 8, 105, 33, 0)

$Button2 = GUICtrlCreateButton("add", 40, 504, 105, 33, 0)

$Button3 = GUICtrlCreateButton("del", 176, 504, 105, 33, 0)

GUISetState(@SW_SHOW)

#EndRegion ### START Koda GUI section ### Form=

Global $inipath = @ScriptDir & "\game.ini"

Global $DistrictList, $Wallpaper, $RunPath, $batPath

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

CheckIni()

Case $Button2

Case $Button3

EndSwitch

WEnd

Func CheckIni()

Local $ReadIni

$ReadIni = IniReadSection($inipath, "oneall")

If @error Then

MsgBox(4096, "", "XXXXXXXXXXX.")

Exit

Else

For $i = 1 To $ReadIni[0][0]

Switch $ReadIni[$i][0]

Case "all"

$DistrictList = StringSplit(IniRead($inipath, "oneall", "all", ""), ",")

GUICtrlCreateListViewItem($DistrictList, $Listview1)

Return True

EndSwitch

Next

EndIf

EndFunc ;==>CheckIni

the game.ini

[oneall]

all=AAA,BBB,CCC,DDD,EEE,FFFFF,GGGGG

Share this post


Link to post
Share on other sites
GEOSoft

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <ListViewConstants.au3>

#include <WindowsConstants.au3>

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

$Form1 = GUICreate("from1", 324, 546, 508, 164)

$ListView1 = GUICtrlCreateListView("all:", 32, 56, 257, 433)

$Button1 = GUICtrlCreateButton("list", 112, 8, 105, 33, 0)

$Button2 = GUICtrlCreateButton("add", 40, 504, 105, 33, 0)

$Button3 = GUICtrlCreateButton("del", 176, 504, 105, 33, 0)

GUISetState(@SW_SHOW)

#EndRegion ### START Koda GUI section ### Form=

Global $inipath = @ScriptDir & "\game.ini"

Global $DistrictList, $Wallpaper, $RunPath, $batPath

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

CheckIni()

Case $Button2

Case $Button3

EndSwitch

WEnd

Func CheckIni()

Local $ReadIni

$ReadIni = IniReadSection($inipath, "oneall")

If @error Then

MsgBox(4096, "", "XXXXXXXXXXX.")

Exit

Else

For $i = 1 To $ReadIni[0][0]

Switch $ReadIni[$i][0]

Case "all"

$DistrictList = StringSplit(IniRead($inipath, "oneall", "all", ""), ",")

GUICtrlCreateListViewItem($DistrictList, $Listview1)

Return True

EndSwitch

Next

EndIf

EndFunc ;==>CheckIni

the game.ini

[oneall]

all=AAA,BBB,CCC,DDD,EEE,FFFFF,GGGGG

$DistrictList Is an array. Calling It like that will not give the results you need

Case "all"
   $DistrictList = StringSplit(IniRead($inipath, "oneall", "all", ""), ",")
   For $I = 1 To $DistrictList[0]
      GUICtrlCreateListViewItem($DistrictList{$I], $Listview1)
   Next
Return True
EndSwitch

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
YOUF

thank you~!

this GUICtrlSendMsg dont work.........why?

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <ListViewConstants.au3>

#include <WindowsConstants.au3>

#include <GuiListView.au3>

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

$Form1 = GUICreate("from1", 324, 546, 508, 164)

$ListView1 = GUICtrlCreateListView("all:", 32, 56, 257, 433)

$Button1 = GUICtrlCreateButton("list", 112, 8, 105, 33, 0)

$Button2 = GUICtrlCreateButton("add", 40, 504, 105, 33, 0)

$Button3 = GUICtrlCreateButton("del", 176, 504, 105, 33, 0)

GUISetState(@SW_SHOW)

#EndRegion ### START Koda GUI section ### Form=

Global $inipath = @ScriptDir & "\game.ini"

Global $DistrictList, $Wallpaper, $RunPath, $batPath

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

CheckIni()

Case $Button2

Case $Button3

EndSwitch

WEnd

Func CheckIni()

Local $ReadIni

$ReadIni = IniReadSection($inipath, "oneall")

If @error Then

MsgBox(4096, "", "XXXXXXXXXXX.")

Exit

Else

For $i = 1 To $ReadIni[0][0]

; Switch $ReadIni[$i][0]

; Case "all"

$DistrictList = StringSplit(IniRead($inipath, "oneall", "all", ""), ",")

For $i = 1 To $DistrictList[0]

$H=GUICtrlCreateListViewItem($DistrictList[$i], $ListView1)

Next

Return True

; EndSwitch

Next

EndIf

YK()

EndFunc ;==>CheckIni

Func YK()

_GUICtrlListView_SetColumnWidth($ListView1, 160, 100)

GUICtrlSendMsg($ListView1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)

$menu1 = GUICtrlCreateContextMenu($ListView1)

$Bpath = GUICtrlCreateMenuItem("Bpath", $menu1)

$ypath = GUICtrlCreateMenuItem("ypath", $menu1)

$xiugai = GUICtrlCreateMenuItem("xiugai", $menu1)

$separator2 = GUICtrlCreateMenuItem("", $menu1, 3)

$bdgx = GUICtrlCreateMenuItem("bdgx ", $menu1)

$fwgx = GUICtrlCreateMenuItem("fwgx", $menu1)

$showallctrl = 1

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Bpath

MsgBox(0, "", $Bpath)

Case $msg = $ypath

MsgBox(0, "", $ypath)

Case $msg = $xiugai

MsgBox(0, "", $xiugai)

Case $msg = $bdgx

MsgBox(0, "", $num)

Case $msg = $fwgx

MsgBox(0, "", $fwgx)

Case $msg = $GUI_EVENT_CLOSE

Exit

EndSelect

WEnd

EndFunc ;==>yk

Share this post


Link to post
Share on other sites
YOUF

sorry,

del "Return True " ,ok

thank

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.