IceMaKeR Posted October 4, 2010 Posted October 4, 2010 (edited) 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 Edited October 4, 2010 by IceMaKeR
wakillon Posted October 4, 2010 Posted October 4, 2010 I can't test it, some parts are missing ! but your switch method seems to be the cause... AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
IceMaKeR Posted October 4, 2010 Author Posted October 4, 2010 (edited) Hello, Thanks for answering. Yes the treeview creation is missing because i create it from an array dinamically. you can use any data in treeview it causes the error. I think that's my switch is the source of my problem too but can't find where! Edited October 4, 2010 by IceMaKeR
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now