#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTreeView.au3>
#Region ### START Koda GUI section ### Form= sljowjkjafojnnn klhdjljlj faffas fmaa ska
Dim $hSitem[30], $Line, $list, $Name, $New, $File, $File1, $TreeView1, $hTreeview, $hSitem1
Global $iStyle = BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)
$Form1 = GUICreate("网卡PNP工具", 501, 371, 192, 114)
$Group2 = GUICtrlCreateGroup("", 0, 318, 500, 7)
GUICtrlCreateGroup("", -99, -99, 1, 1)
;~ $Pic1 = GUICtrlCreatePic(@ScriptDir & "\123.jpg", 0, -10, 500, 69)
$Group1 = GUICtrlCreateGroup("", 0, -8, 500, 70)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$hTreeview = GUICtrlCreateTreeView(16, 88, 473, 215, $iStyle, $WS_EX_CLIENTEDGE)
$hFitem01 = GUICtrlCreateTreeViewItem("网卡驱动程序", $hTreeview)
Local $num = 2
For $i = 1 To 25
;~ $File = FileOpen(@ScriptDir & "\setup.ini")
;~ $File = FileReadLine($File, $num)
;~ If $File = "" Then Exit
;~ $Name = StringReplace($File, 'NIC' & $num - 1 & '=', "", 0)
;~ ;MsgBox(0,"提示",$name)
;~ FileClose($File)
;~ $num = $num + 1
;~ $Name = IniRead(@ScriptDir & "\setup.ini", $Name, "name", "")
$hSitem[$i] = GUICtrlCreateTreeViewItem(StringFormat("%02s","网卡驱动"&$i),$hFitem01)
Next
$Label1 = GUICtrlCreateLabel("请选择对应网卡驱动", 24, 72, 112, 17)
$Button1 = GUICtrlCreateButton("全选", 58, 333, 89, 33)
$Button2 = GUICtrlCreateButton("反选", 168, 333, 89, 33)
$Button3 = GUICtrlCreateButton("开始PNP", 280, 333, 89, 33)
$Button4 = GUICtrlCreateButton("退出", 392, 333, 89, 33)
GUICtrlSetState($hFitem01, $GUI_EXPAND)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $hFitem01
If BitAND(GUICtrlRead($hFitem01), $GUI_CHECKED) Then
For $i = 1 To 25
GUICtrlSetState($hSitem[$i], $GUI_CHECKED)
Next
ElseIf BitAND(GUICtrlRead($hFitem01), $GUI_UNCHECKED) Then
For $i = 1 To 25
GUICtrlSetState($hSitem[$i], $GUI_UNCHECKED)
Next
EndIf
Case $Button1 ;全选
GUICtrlSetState($hFitem01, $GUI_CHECKED)
For $i = 1 To 25
GUICtrlSetState($hSitem[$i], $GUI_CHECKED)
Next
Case $Button2 ;反选
Local $num=0
Local $flag=False
For $i = 1 To 25
Local $check=_GUICtrlTreeView_GetChecked($hTreeview, $hSitem[$i])
If $check=False Then $num+=1
_GUICtrlTreeView_SetChecked($hTreeview,$hSitem[$i], NOT($check))
Next
If $num>=25 Then $flag=True
_GUICtrlTreeView_SetChecked($hTreeview,$hFitem01, $flag)
Case $Button3 ;PNP
For $i = 1 To 25
If GUICtrlRead($hSitem[$i]) = 1 Then
;~ DirCreate(@ScriptDir & '\' & $i)
MsgBox(0, "提示", $i)
EndIf
Next
Case $Button4 ;退出
Exit
EndSwitch
WEnd
|