Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <Array.au3>
#include <GUIListBox.au3>
Local $Indice
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 282, 235, 192, 124)
GUISetBkColor(0x00E0FFFF)
$btnsolyog = GUICtrlCreateButton("Ex Yogui", 160, 174, 100, 30, $BS_FLAT)
$btnsolTlem = GUICtrlCreateButton("EX Tlem", 160, 204, 100, 30, $BS_FLAT)
$btnsolAyu = GUICtrlCreateButton("EX Ayuckers", 60, 204, 100, 30, $BS_FLAT)
$hlistview = GUICtrlCreateListView("Processus|UC", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$List = ProcessList()
For $x = 2 To $List[0][0]
GUICtrlCreateListViewItem($List[$x][0] & "|", $hlistview)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
; *************** ordre croissant et decroissant **********************************
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($hListView)]
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $btnsolyog
$PCnok = GUICtrlRead(GUICtrlRead($hlistview))
$PCnok = StringSplit($PCnok, "|")
$PCnok = $PCnok[1]
MsgBox(0, "", $PCnok)
Case $btnsolTlem
$Indice = _GUICtrlListView_GetSelectedIndices($hlistview)
If $Indice < 0 Then
MsgBox(0, "", "merci de séléctionner une ligne")
Else
;MsgBox(0, '', $Indice)
MsgBox(0, '', $List[$Indice + 2][0]&" --> "&$List[$Indice + 2][1])
EndIf
Case $btnsolAyu
$Indice = _GUICtrlListView_GetSelectedIndices($hListView) ; récupere l'indice de la ligne sélectionné
$Item = _GUICtrlListView_GetItem($hListView,int($Indice),0); Le 0 permet de recuperer dans la colonne 1
MsgBox(4160, "Text : ", $Item[3]); ici $Item[3] pour recuperer la parti text
EndSwitch
WEnd
;****************************************************************************************************************************
;****************************************************************************************************************************
;****************************************************************************************************************************
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 $LVN_COLUMNCLICK ; A column was clicked
$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
_GUICtrlListView_SimpleSort($hWndListView, $B_DESCENDING, DllStructGetData($tInfo, "SubItem"))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY