#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiConstantsEx.au3>
#include <Array.au3>
$user = @ScriptDir & "\user.ini"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 198, 352, 192, 114)
$ListView1 = GUICtrlCreateListView("", 16, 8, 161, 281, $WS_BORDER, $LVS_ICON)
GUICtrlSetBkColor(-1, 0x3A6EA5)
_GUICtrlListView_SetView($ListView1, 3);设置样式,可选(1、2、3、4)
$Button1 = GUICtrlCreateButton("排序", 8, 304, 169, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_duuser()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Sort()
EndSwitch
WEnd
Func Sort()
$var = IniReadSection($user, "在线用户")
_ArraySort($var, 0, 1)
IniWriteSection($user, "在线用户", $var)
_duuser()
EndFunc ;==>Sort
Func _duuser()
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView1))
$var = IniReadSection($user, "在线用户")
If Not @error Then
For $i = 1 To $var[0][0]
GUICtrlCreateListViewItem($var[$i][0], $ListView1)
GUICtrlSetImage(-1, "shell32.dll", -19)
Next
EndIf
EndFunc ;==>_duuser
|