Hallo TheLuBu,
ich hätte dies so behandelt:
Spoiler anzeigen
Func WM_NOTIFY($hWnd, $msgID, $wParam, $lParam)
Local $tagNMHDR, $event, $hwndFrom, $code, $aItems
$tagNMHDR = DllStructCreate("int;int;int", $lParam)
$code = DllStructGetData($tagNMHDR, 3)
If @error Then Return 0
;ConsoleWrite($wParam & " " & $LV_Agent[$iActiveTab] & @CRLF)
Switch $wParam
Case $LV_Agent[$iActiveTab]
Switch $code
Case $NM_CLICK
$iActiveAgent = GUICtrlRead($LV_Agent[$iActiveTab])
$aItems = _GUICtrlListView_GetSelectedIndices($LV_Agent[$iActiveTab],True)
If IsArray($aItems) Then
if $aItems[0] > 0 Then $iActiveAgent = $aItems[1]
;ConsoleWrite($iActiveAgent & " Name " & GUICtrlRead($iActiveAgent) & @CRLF)
_GUICtrlListView_EnsureVisible($LV_Kontakt[$iActiveTab], $iActiveAgent)
_GUICtrlListView_SetItemSelected($LV_Kontakt[$iActiveTab], $iActiveAgent)
EndIf
EndSwitch
Case $LV_Kontakt[$iActiveTab]
Switch $code
Case $NM_CLICK
$iActiveAgent = GUICtrlRead($LV_Kontakt[$iActiveTab])
$aItems = _GUICtrlListView_GetSelectedIndices($LV_Kontakt[$iActiveTab],True)
If IsArray($aItems) Then
if $aItems[0] > 0 Then $iActiveAgent = $aItems[1]
;ConsoleWrite($iActiveAgent & " Name " & GUICtrlRead($iActiveAgent) & @CRLF)
_GUICtrlListView_EnsureVisible($LV_Agent[$iActiveTab], $iActiveAgent)
_GUICtrlListView_SetItemSelected($LV_Agent[$iActiveTab], $iActiveAgent)
EndIf
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
obwohl mir kein Fall aufgefallen ist in dem $aItems kein Array ist, erscheint mir diese Methode sicherer,
mfg autoBert