Coucou,
Afin de détecter un click droit sur la listview, il faut utiliser ceci :
Code : Tout sélectionner
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$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_RCLICK ; detect click droit
;on place dans un tableau.
EndSwitch
EndSwitch
EndFunc ;==>WM_NOTIFY
Je n'ai pas trop le temps de taper la fonction pour ranger dans un tableau, mais il suffit de lire la listview jusqu'a la dernière ligne et de stock chaque ligne / colonne dans un tableau
J'avais aussi fait quelque chose pour l'envoyer dans un tableau excel, un peu la même
Code : Tout sélectionner
#include <Guilistview.au3>
#include <excel.au3>
GUICreate("listview items", 220, 250, 100, 200)
$listview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150)
$item1 = GUICtrlCreateListViewItem("item2|col22|col23", $listview)
$item2 = GUICtrlCreateListViewItem("item1|col12|col13", $listview)
$item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview)
GUISetState()
Sleep(2000)
$oExcel = _ExcelBookNew()
$iItems = _GUICtrlListView_GetItemCount($listview)
For $iItem = 0 To $iItems-1
$Zf = _GUICtrlListView_GetItemTextString($listview, $iItem)
$Zf = StringSplit($Zf, "|", 1)
_ExcelWriteArray($oExcel, $iItem + 1, 1, $Zf, 0, 1)
Next
Jérôme