pingpong123 Posted September 13, 2007 Share Posted September 13, 2007 Hi All, I have created a treeview control which has checkbox and +/- button against each item. I couldn't able to find a way to know as when the user check/uncheck or click on +/- buttons of a particular tree view item....... I am using GUIGetMsg() but it is giving the notification only when the user single click on the item but it is not giving any info when user checks the checkbox of the item....Is there any way to accomplish this task... Any help would be highly appreciated.... Link to comment Share on other sites More sharing options...
smashly Posted September 13, 2007 Share Posted September 13, 2007 (edited) Hi, GUIRegisterMsg() would probably be the best way to catch msgs when the tree item is clicked.. Myself I used the $WM_NOTIFY msg in combination with API Constants of TVM_HITTTEST and $TVHT_ONTITEMSTATEICON to register the Checkbox as being clicked... Cheers Edit: the reason I needed to know if a checkbox is being clicked is so I could set the unexpanded children to be checked or unchecked as well. Edited September 13, 2007 by smashly Link to comment Share on other sites More sharing options...
pingpong123 Posted September 13, 2007 Author Share Posted September 13, 2007 Yeah, even I tried out the same way by making use of TVN_ITEMEXPANDED notifications but it is giving the control Id of the tree but not of the items...but it's really funny that they haven't provided a quick way to see which tree item has been checked/+/- button pressed Link to comment Share on other sites More sharing options...
smashly Posted September 13, 2007 Share Posted September 13, 2007 (edited) $TVHT_ONTITEMBUTTON , use that to find if a + or - button has been hit... $TVHT_ONTITEMSTATEICON , if a check box has been hit... Edit: If your using the above with register msg then you'll need to declare them as a constant.. To get a great list of windows constants then have a look in the downloads section for Windows APIConstants , that someone else has already done the hard yards and put together a gui listing a majority of them to make your life easier.. Edited September 13, 2007 by smashly Link to comment Share on other sites More sharing options...
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