PaulDG Posted October 24, 2005 Posted October 24, 2005 (edited) Is there any way to check and uncheck treeview items from there handle instead of there id's, without using _GUICtrlTreeViewGetParentID. Using Sendmsg I can find out all the handles of the children of a parent node, when that node is checked I would like to check all its children and vice versa. I would also like to be able to detect if a child is checked or not by using there handle, again without having to use _GUICtrlTreeViewGetParentID. Alternatively, is there anyway to get the ID of a treeviewitem from its handle, without having to actually give focus to that item and read it. I would not even mind running an array/hash of id's/handles so I could look them up if I could figure out a way to read the handle at the same time as I defined the control. Many Thanks for any help. Edit: Sorry Wrong section Edited October 24, 2005 by PaulGX
wiredbits Posted October 24, 2005 Posted October 24, 2005 Is there any way to check and uncheck treeview items from there handle instead of there id's, without using _GUICtrlTreeViewGetParentID.Using Sendmsg I can find out all the handles of the children of a parent node, when that node is checked I would like to check all its children and vice versa. I would also like to be able to detect if a child is checked or not by using there handle, again without having to use _GUICtrlTreeViewGetParentID.Alternatively, is there anyway to get the ID of a treeviewitem from its handle, without having to actually give focus to that item and read it. I would not even mind running an array/hash of id's/handles so I could look them up if I could figure out a way to read the handle at the same time as I defined the control.Many Thanks for any help.Edit: Sorry Wrong section try this $controlID=GuiCtrlRead($TreeView) ;returns ID of control who has focus $state=GUICtrlRead($controlID) $state=BitAND($state,$GUI_CHECKED+$GUI_UNCHECKED)
PaulDG Posted October 24, 2005 Author Posted October 24, 2005 Hi wiredbits, I think you mis-understood my question, I need to check and uncheck all the children of the current item that has focus, not the current item itself. Thanks
wiredbits Posted October 24, 2005 Posted October 24, 2005 try this $controlID=GuiCtrlRead($TreeView) ;returns ID of control who has focus $state=GUICtrlRead($controlID) $state=BitAND($state,$GUI_CHECKED+$GUI_UNCHECKED) your correct , two hours of sleep and this hurricane has got me a little buggy..LOL Now you have me wanting to check out GUICtrlSendMsg/GUICtrRecvMsg..time for me to to jump over to MSDN. Later Jim
PaulDG Posted October 24, 2005 Author Posted October 24, 2005 Can anyone else shed any light on this?
wiredbits Posted October 25, 2005 Posted October 25, 2005 Can anyone else shed any light on this? Your idea using arrays is what I do. I keep parents and kids IDs in an array then check/uncheck all in that node depending on user selection....works for me. I think doing it by handles you will need to use Sendmsg via API call.
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