Sign in to follow this  
Followers 0
HeWhoLaughedLast

How to check checkboxes arranged on a treeview

8 posts in this topic

Hi,

Before i begin, I am a complete novice and am attempting to use autoit for some simulation run on a third party software which is in VisualBasic6.0

My problem is this:

I need to be able to check certain checkboxes that are on a treeview. I can get the classnameNN for the Treeview(TreeView20WndClass5) but have no clue how to go about checking the checkboxes (based on the associated text for the checkbox) on the tree.

The ActiveWindowInfo Tool does not return any controlid,text,.. for the individual checkboxes.

A nudge in the right direction would be helpful.

Is this even possible with autoit?

Cheers,

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Auto3Lib in the example scripts ;) god i love being able to just throw around Paulias UDF god is it nice

Edit: beat to it by gary xD

Edited by Thatsgreat2345

Share this post


Link to post
Share on other sites

Brilliant! That seems to be what i am looking for. Thanks guys.

Will have a crack and let you know how i go.

Share this post


Link to post
Share on other sites

With the libraries I can get the handle of the desired text box. I have even add some of my own functionality such that i can get the handle of a node in the tree given its title (or a part of the title).

But the handles refer to nodes in the tree only. Any idea how to get the controlID, etc.. of the control on that node?

Any help is appreciated.

Cheers

Share this post


Link to post
Share on other sites

With the libraries I can get the handle of the desired text box. I have even add some of my own functionality such that i can get the handle of a node in the tree given its title (or a part of the title).

But the handles refer to nodes in the tree only. Any idea how to get the controlID, etc.. of the control on that node?

Any help is appreciated.

Cheers

The nodes in the tree are managed by the tree itself. There is no control ID for the items (in the sense that you are asking about). Do not try to mix the AutoIT GUI calls with the Auto3Lib calls or you'll run into trouble. Just use the handles provided by Auto3Lib and you'll be in good shape.

Also, if there is functionality that you found missing, I would be interested to here about it. Most of the enhancements that I have made have been as the result of user feedback. Feel free to PM or email me with your suggestions.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

Paul,

The attached image shows the TreeView with the checkboxes on them. The AutoIt Active Window Info Tool seems to show me the handle for the treeview itself.

The handle provided by the Auto3Lib gives me the handles to the node (that bit is fine) but as you can see there are custom controls (checkboxes here) attached to each node.

How do i check any of the checkboxes?

If there is existing functionality for this then i missed it.

It is quite possible that there is something that i have missed (Ive only been using AutoIt for a week or so, and Id like to add that it is wonderful so far). So a nudge would be lovely.

Cheers,

p.s. I guess what i am trying to do is figure out what control is sitting on a node (if any) and then send messages to it based on its type (checkboxes in this case).

post-18425-1164944909_thumb.jpg

Share this post


Link to post
Share on other sites

Paul,

The attached image shows the TreeView with the checkboxes on them. The AutoIt Active Window Info Tool seems to show me the handle for the treeview itself.

The handle provided by the Auto3Lib gives me the handles to the node (that bit is fine) but as you can see there are custom controls (checkboxes here) attached to each node.

How do i check any of the checkboxes?

If there is existing functionality for this then i missed it.

It is quite possible that there is something that i have missed (Ive only been using AutoIt for a week or so, and Id like to add that it is wonderful so far). So a nudge would be lovely.

Cheers,

p.s. I guess what i am trying to do is figure out what control is sitting on a node (if any) and then send messages to it based on its type (checkboxes in this case).

This is a not a standard TreeView control. A standard TreeView control has the class name "SysTreeView32". If this is some kind of descendent of a true TreeView control and the developers haven't screwed around too much with it, Auto3Lib will work. The checkboxes you are referring to aren't custom controls. A TreeView control can display checkboxes, depending on the style specified during the control creation. If you want to see how to check/uncheck the boxes in a true TreeView control, take a look at the Performance Options demo script in the Examples folder.

Auto3Lib: A library of over 1200 functions for AutoIt

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