#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
Opt("GUIOnEventMode", 1)
Global $aElement[2], $hActive, $iInput
Global $iListView, $hListView, $dummy1, $dummy2
$hGUI = GUICreate('', 450, 360)
GUISetOnEvent(-3, '_Exit')
$iInput = GUICtrlCreateInput("", 0, 0, 0, 0)
GUICtrlSetState(-1, $GUI_HIDE)
$iListView = GUICtrlCreateListView('Col 1|Col 2', 5, 5, 440, 330, BitOR($GUI_SS_DEFAULT_LISTVIEW, $LVS_REPORT, $LVS_SHOWSELALWAYS))
$hListView = GUICtrlGetHandle(-1)
For $i = 1 To 20
$item1 = Random(10, 99, 1)
$item2 = ''
For $j = 1 To 9
$item2 &= Chr(Random(65, 90, 1)) ; 192, 255 - Ru
Next
GUICtrlCreateListViewItem($item1 & '|' & $item2, $iListView) ; создаём пункты
Next
GUISetState()
GUIRegisterMsg(0x4E, "_WM_NOTIFY")
While 1
Sleep(100000)
WEnd
Func _WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hListView
Switch $iCode
Case $NM_CLICK ; двойной клик - редактируем пункт ListView
Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;ToolTip(_GUICtrlListView_GetItemText($hListView, DllStructGetData($tInfo, "Index"), DllStructGetData($tInfo, "SubItem")))
MsgBox(0,"", _GUICtrlListView_GetItemText($hListView, DllStructGetData($tInfo, "Index"), DllStructGetData($tInfo, "SubItem")) & ". Row " & _
DllStructGetData($tInfo, "Index") & ". Column " & DllStructGetData($tInfo, "SubItem"))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
Func _Exit()
Exit
EndFunc