#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiToolbar.au3>
#include <ImageListConstants.au3>
#include <ListViewConstants.au3>
#include <ToolbarConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=f:\软件管家\软件管家.kxf
$Form1_1 = GUICreate("Form1", 816, 573, 191, 112)
$ListView1 = GUICtrlCreateListView("软件名称|版本|备注", 200, 40, 609, 465, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 270)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 70)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, -2)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$ListView2 = GUICtrlCreateListView("全部软件", 0, 40, 194, 465)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, -2)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("批量安装", 688, 512, 115, 33, -1, $WS_EX_CLIENTEDGE)
;-----------------------------------------------------------------------
#include <GuiListView.au3>
#include <array.au3>
_GUICtrlListView_JustifyColumn($ListView2, 0, 2)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
;-----------------------------------------------------------------------
GUISetState(@SW_SHOW)
$SoftType = IniReadSectionNames(@ScriptDir & "\soft.ini")
Dim $SoftTypeIndex[$SoftType[0] - 1], $TEMP_SOFTTYPE_ARRAY[1]
For $i = 1 To $SoftType[0]
GUICtrlCreateListViewItem($SoftType[$i], $ListView2)
$SoftVar = IniReadSection(@ScriptDir & "\soft.ini", $SoftType[$i])
If @error Then ContinueLoop
ReDim $TEMP_SOFTTYPE_ARRAY[$SoftVar[0][0]]
For $ii = 1 To $SoftVar[0][0]
GUICtrlCreateListViewItem($SoftVar[$ii][0], $ListView1)
$TEMP_SOFTTYPE_ARRAY[$ii - 1] = $SoftVar[$ii][0]
Next
$SoftTypeIndex[$i - 1] = $TEMP_SOFTTYPE_ARRAY
Next
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
$tNMTV = DllStructCreate($tagNMTVDISPINFO, $ilParam)
$iCode = DllStructGetData($tNMTV, "Code")
$iIndex = _GUICtrlListView_GetSelectedIndices($ListView2)
Switch $iCode
Case $NM_CLICK
If ($iIndex) Then
_ArrayDisplay($SoftTypeIndex[0])
MsgBox(0, $iIndex, IsArray($SoftTypeIndex[$iIndex]))
EndIf
EndSwitch
$tNMTV = 0
EndFunc ;==>WM_NOTIFY