Sign in to follow this  
Followers 0
OmYcroN

Run function when treeview item is clicked

3 posts in this topic

#1 ·  Posted (edited)

Hello. I have a treeview and items added with _GUICtrlTreeView_AddChild()

and their handles stored into an array. If I use the code below it will always run

the function but i want to use Function() only when clicking the item. I've used

$arrGuiMsg[2] <> 0x000000 but with no luck. So the problem is what happens when

an item is clicked in this situation ? How can i handle it ?

Global $arrGuiMsg
While True
    $arrGuiMsg = GUIGetMsg(1)
    Switch $arrGuiMsg[1]
        Case $window
            Switch $arrGuiMsg[0]
            EndSwitch
      
            Switch $arrGuiMsg[2]
                Case $arrItemHandles[0][0] To $arrItemHandles[Ubound($arrItemHandles) - 1][0]
                       If $arrGuiMsg[2] <> 0x000000 Then
                               Function()
                       Endif
            EndSwitch
    EndSwitch
WEnd
Edited by OmYcroN

Share this post


Link to post
Share on other sites



I've looked at WM_NOTIFY but I can't fint the correct case for checking/unchecking a checkbox. $NM_CLICK gets all clicks within the treeview. It there is other example on this matter please direct me. Thanks.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0