#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("form1", 324, 546, 508, 164)
$ListView1 = GUICtrlCreateListView("所有列表:", 32, 56, 257, 433)
$Button1 = GUICtrlCreateButton("读取列表", 112, 8, 105, 33, 0)
$Button2 = GUICtrlCreateButton("添加", 40, 504, 105, 33, 0)
$Button3 = GUICtrlCreateButton("删除", 176, 504, 105, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
Global $inipath = @ScriptDir & "\game.ini"
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 = IniReadSectionNames($inipath)
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $ReadIni[0]
$item = GUICtrlCreateListViewItem($ReadIni[$i], $Listview1)
Next
EndIf
_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
Case $msg = $ypath
Case $msg = $xiugai
Case $msg = $bdgx
$num = String(GUICtrlRead(GUICtrlRead($Listview1)))
MsgBox(0,"",$num)
MsgBox(0,"", StringIsAlNum($num))
Case $msg = $fwgx
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
EndFunc ;==>CheckIni
[ 本帖最后由 木纳 于 2008-5-20 21:48 编辑 ] |