Jump to content

Run function when treeview item is clicked


OmYcroN
 Share

Recommended Posts

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
Link to comment
Share on other sites

GUIGetMsg() works with control id's as used by the internal GUICtrl* functions. Look at the example for _GUICtrlTreeView_Create() for how to react to clicks

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...