Basic example:
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>
Global $g_idListView, $g_idSearch
Example()
Func Example()
GUICreate("listview items", 220, 250)
$g_idListView = GUICtrlCreateListView("Section Name|Description", 10, 10, 200, 150) ;,$LVS_SORTDESCENDING)
Local $idButton = GUICtrlCreateButton("Search", 75, 170, 70, 20)
Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23", $g_idListView)
Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13", $g_idListView)
Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $g_idListView)
$g_idSearch = GUICtrlCreateInput("", 20, 200, 150)
GUISetState(@SW_SHOW)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idButton
_Search()
EndSwitch
WEnd
EndFunc
Func _Search()
Local $sSearch = GUICtrlRead($g_idSearch)
;~ No Search text added, so return to Gui
If StringStripWS($sSearch, 8) = "" Then Return
Local $sConfig = @ScriptDir & "\Config.ini"
Local $sDesc, $aSectionNames = IniReadSectionNames($sConfig)
If @error Then Return
;~ Delete all items from the list view
_GUICtrlListView_DeleteAllItems($g_idListView)
For $i = 1 To $aSectionNames[0]
If StringInStr($aSectionNames[$i], $sSearch) Then
$sDesc = IniRead($sConfig, $aSectionNames[$i], "Desc", "")
If StringStripWS($sDesc, 8) = "" Then ContinueLoop
GUICtrlCreateListViewItem($aSectionNames[$i] & "|" & $sDesc, $g_idListView)
EndIf
Next
EndFunc