#include <GuiListView.au3>
;#include <Array.au3>
$Form_main = GUICreate("", 930, 520, -1, -1)
Local $disklist = GUICtrlCreateListView("", 10, 100, 910, 200);, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
_guictrllistview_insertcolumn($disklist, 0, "编号", 40, 2)
_guictrllistview_insertcolumn($disklist, 1, "盘符", 40, 2)
_guictrllistview_insertcolumn($disklist, 2, "总共空间", 60, 2)
_guictrllistview_insertcolumn($disklist, 3, "剩余空间", 60, 2)
_guictrllistview_insertcolumn($disklist, 4, "分区类型", 60, 2)
_guictrllistview_insertcolumn($disklist, 5, "分区格式", 60, 2)
;_guictrllistview_insertcolumn($disklist, 6, " 盘符", 0, 2)
_guictrllistview_insertcolumn($disklist, 7, "引导类型", 60, 2)
_guictrllistview_insertcolumn($disklist, 8, "激活", 50, 2)
fqxx()
GUISetState(@SW_SHOW, $Form_main)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
EndSwitch
WEnd
Func fqxx()
Local $diskinfo = FileOpen(@ScriptDir & "\Partinfo.txt", 0)
Local $partinfo = FileRead($diskinfo)
$partinfo =StringRegExpReplace($partinfo," "," 无盘符 ")
$partinfo =StringRegExpReplace($partinfo,"Primary","主分区")
$partinfo =StringRegExpReplace($partinfo,"Logical","逻辑分区")
Local $aData = StringRegExp($partinfo, '(?mi)^(\d:\d)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\d)\s*', 3)
;_ArrayDisplay($aData)
For $i = 0 To UBound($aData) - 1 Step 9
If $aData[$i + 8] = "1" Then
$aData[$i + 8] = "O"
Else
$aData[$i + 8] = "X"
EndIf
GUICtrlCreateListViewItem($aData[$i] & "|" & $aData[$i + 1] & "|" & $aData[$i + 2] & "|" & $aData[$i + 3]& "|" & $aData[$i + 4]& "|" & $aData[$i + 5]& "|" & $aData[$i + 7]& "|" & $aData[$i + 8], $disklist)
Next
EndFunc