Je suis confronté à un problème avec "GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")".
En effet, j'ai 2 GUI et dans chaque GUI une ListView.
Le soucis est que ça ne reconnait qu'une seule ListView... comment faire pour detecter le double clic de telle ou telle ListView pour faire un Case dans la fonction (Si cela est faisable...):
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
Local $tBuffer
;SI CLIC ListView1 ALORS
$hWndListView = "$ListView1"
;SINON
$hWndListView = "$ListView3"
;;;;If Not IsHWnd($ListView1) Then $hWndListView = GUICtrlGetHandle($ListView1)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView = "$ListView1"
Switch $iCode
Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
If _GUICtrlListView_GetNextItem($ListView1) = -1 Then
Return
Else
_MaFonction1()
EndIf
EndSwitch
Case $hWndListView = "$ListView3"
Switch $iCode
Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
If _GUICtrlListView_GetNextItem($ListView3) = -1 Then
Return
Else
_MaFonction2()
EndIf
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Merci par avance.
Modifié en dernier par Hugues le lun. 16 sept. 2013 16:27, modifié 1 fois.
Switch $hWndFrom
Case $hWndListView = "$ListView1"
En fait il y a 3 erreurs sur cette ligne
- les doubles quotes
- la syntaxe du select pour un switch
- le $ListView1 qui est peut-être un ID et pas un handle (pas vérifié avant)
" L'échec est le fondement de la réussite. " (Lao-Tseu ) " Plus ça rate, plus on a de chances que ça marche " (les Shadoks )