Hi,
Ich habe mich an ein Script gemacht das es ermöglicht Functionen per Doppelklick auf ListView Items zu starten.
Ich habe schon den Ansatz geschaft leider Funktioniert diese nur wenn man den Namen des ListView Items kennt wei man in Zeile 6 sieht das.Will ich aber geändert haben so das es egal ist auf welches Item man klickt und trotzdem immer die MSgBox angezeigt wird (diese dient nur als Test später kommt dort eine Function hin !):
Spoiler anzeigen
GUISwitch($L_Login)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
Func _LeftDblClick($aInfo)
Switch _GUICtrlListView_GetItemText($hListView, $aInfo[3], $aInfo[4])
Case "Hallo"
MsgBox(0,"",$hlistview)
EndSwitch
EndFunc ;==>_LeftDblClick
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView
$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 ; Control
Case $hWndListView ; If Control = ListView
Switch $iCode ; Event
Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
;Gather Data to pass to the "LeftDblClick" Function
Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
Local $aInfo[12] = [$hWndFrom, $iIDFrom, $iCode, _
DllStructGetData($tInfo, "Index"), _
DllStructGetData($tInfo, "SubItem"), _
DllStructGetData($tInfo, "NewState"), _
DllStructGetData($tInfo, "OldState"), _
DllStructGetData($tInfo, "Changed"), _
DllStructGetData($tInfo, "ActionX"), _
DllStructGetData($tInfo, "ActionY"), _
DllStructGetData($tInfo, "lParam"), _
DllStructGetData($tInfo, "KeyFlags")]
_LeftDblClick($aInfo)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Ich hoffe ihr könnt mir helfen