浪费我睡觉时间啦,原来有答案。。。#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$wintitle = "TEST"
$Form1 = GUICreate($wintitle)
$ListView1 = GUICtrlCreateListView("1", 32, 32, 340, 340)
$ListView1_0 = GUICtrlCreateListViewItem("a", $ListView1)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iCode, $tNMHDR, $tInfo
$hWndListView1 = HWnd(GUICtrlGetHandle($ListView1))
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView1
Switch $iCode
Case $NM_DBLCLK ; 双击
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
ListView_Click($ListView1)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func ListView_Click($list)
Local $d, $item
$d = _GUICtrlListView_GetSelectedIndices($list)
$item = _GUICtrlListView_GetItemTextArray($list, $d - 0)
MsgBox(1,"",$item[1])
EndFunc ;==>ListView_Click
|