Hello all,
i need help managing treeview.
In my script when i click on an item in my treeview the first click don't do anything.
The second one returns the result of the first click, the third returns the second selection and etc...
i have seen that the $NM_CLICK execute my function but before the action of selecting my tree object.
Can some one explain me the way to make my script run AFTER the selection action?
Thanks.
Global $TreeList = GUICtrlCreateTreeView(15, 50, 200, 270, $iStyle, $WS_EX_CLIENTEDGE)
Global $TreeView = GUICtrlGetHandle($TreeList)
GUIRegisterMsg($WM_NOTIFY, '_OnNotify')
Func _OnNotify($hWnd, $Msg, $wParam, $lParam)
Local $tNMHDR, $hWndFrom, $iCode
$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
$hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $TreeView
Switch $iCode
Case $NM_CLICK
Local $tINFO = DllStructCreate($tagNMTREEVIEW, $lParam)
Local $hControl = DllStructGetData($tINFO, "NewhItem")
Local $sTVIsSelected =_GUICtrlTreeView_GetText($TreeList, _GUICtrlTreeView_GetSelection($TreeList))
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sTVIsSelected = ' & $sTVIsSelected & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>_OnNotify