#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
$Gui = GUICreate("Test", 200, 250)
$hListView = _GUICtrlListView_Create($GUI, "Items|SubItems", 5, 2, 190, 200, BitOR($LVS_EDITLABELS, $LVS_REPORT))
Dim $aData[4][2]=[["Борис", 44], ["Анна", 55], ["Света", 11], ["Миша",22]]
For $i=0 To 3
$iItem = _GUICtrlListView_AddItem($hListView, "")
For $j=0 To 1
_GUICtrlListView_SetItemText($hListView, $iItem, $aData[$i][$j], $j)
Next
Next
$Button=GUICtrlCreateButton('Delete',5, 220, 60, 20)
GUICtrlSetState(-1,$GUI_HIDE )
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
;........
EndSwitch
WEnd
;==============================================
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
;==================================================================
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_CLICK
GUICtrlSetState($Button,$GUI_Show )
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ; ===> WM_NOTIFY