刚好找到个例子
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("数字运算问题", 382, 139, 214, 150)
GUISetOnEvent($GUI_EVENT_CLOSE, "Event")
$ListView1 = GUICtrlCreateListView("1 |2", 40, 24, 300, 89)
;GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100)
$ListView1_0 = GUICtrlCreateListViewItem("123 |456", $ListView1)
GUICtrlSetOnEvent($ListView1_0, "Event")
$ListView1_1 = GUICtrlCreateListViewItem("456 |789", $ListView1)
GUICtrlSetOnEvent(-1, "Event")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Event()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case Else
$Val = GUICtrlRead(@GUI_CtrlId, 1)
$Val = StringSplit($Val, "|", 1)
MsgBox("", $Val[1], "相加结果:"&$Val[2]+$Val[1])
EndSwitch
EndFunc ;==>Event
|