Sign in to follow this  
Followers 0
Kovensky

Selecting/Deselecting Treeview items

4 posts in this topic

#1 ·  Posted (edited)

I want to make an automated installation of the Vista Inspirat 2 BricoPack at http://www.crystalxp.net

I get stuck in the part where I have to select/unselect items on the list. Just selecting an installation mode on the combo box doesn't suffice, because the minimal installation doesn't include sounds and all the other options include a Dock, which I don't want.

So, when I get to the component screen, I put the combo box to the Full option with ControlCommand call and try to de-select the Dock option, which is located at 50, 90 control coordinates (according to AutoIt Window Info) sending a click signal there (exactly on top of the checkmark, not on the text), but the only thing the click does is selecting the item on the list, not checking/unchecking it.

I tried to click multiple times, even getting a handle with GUICtrlRead("SysTreeView321") (Class SysTreeView32, Instance 1) and using GUICtrlSetState to $GUI_UNCHECKED, but it didn't work.

The only method that works is using MouseClick, but the machine where I'm going to install the program doesn't use the same resolution as my machine. And even changing resolutions so I can make the script would break it when I tried to install on even another machine with another resolution.

Below is the current code part that's giving me trouble:

ControlCommand("Vista Inspirat 2 1.0 Setup", "", "ComboBox1", "SelectString", "Total")
ControlClick("Vista Inspirat 2 1.0 Setup", "", "SysTreeView321", "left", 1, 16, 92)
ControlClick("Vista Inspirat 2 1.0 Setup", "", "SysTreeView321", "left", 1, 100, 90)

A working version, but that uses the mouse and doesn't work unless when you're in 1280x1024 is:

ControlCommand("Vista Inspirat 2 1.0 Setup", "", "ComboBox1", "SelectString", "Total")
MouseClick("main", 581, 558)
MouseClick("main", 618, 556)

The question is: Is there a beta version that can help me, any system calls that work, any obscure feature that can help? I looked on Google and MSDN but they gave me no clue either.

EDIT:

After some more searching, I found a topic saying that ControlSend("titleOfWindow","","SysTreeView321","keystrokes") should work via the keyboard navigation. It is simple enough and gave me a solution, but a rather complicated one if I automate a program just a bit bigger. So I'm looking for a definite solution here.

The working version, but not with the most natural way of doing stuff

ControlCommand("Vista Inspirat 2 1.0 Setup", "", "ComboBox1", "SelectString", "Total")
ControlSend("Vista Inspirat 2 1.0 Setup", "", "SysTreeView321", "{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{RIGHT}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{SPACE}")
Edited by Kovensky

Share this post


Link to post
Share on other sites



Neither this BricoPack or Vista Transformation Pack support silent switches, so AutoIt has to do the job. And I found a bug with the Keyboard approach right away: I uninstalled the program and tried to install it again. The Dock came along. Oh well, I don't have anything against it, but I think that the people who use the computer will mess with it since it supports drag-and-drop.

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