Jump to content

Help with ControlListView command

Recommended Posts


In HP driver installs I have the below window that lists all found printers.  I want AutoIt to click on a line if it finds the correct MAC address and then click the Next button.  User "orbs" graciously pointed me to the ControlListView command to do this but I have found the documentation on this command a bit lacking and need some clarification.

In trying to experiment with the command, it seems like I almost need nested ControlListView commands to feed the result of the FindItem control to the Select control like so:

ControlListView ( "HP Officejet Pro 8600", "", 2001, "Select", ControlListView ( "HP Officejet Pro 8600", "", 2001, "FindItem", "8851FB150E26",3))

Tried this in my script and it didn't work...and it crashed the HP installer.  :(  So...

1) What does the last field in FindItem declare as it isn't documented well?  The documentation says SubItem, which the documentation also declares to be a column value, so does this allow you to tell the FindItem control to only look in a certain column in the table ? (In my above example I put a 3 as I want it to look in column 3, the MAC address column)

2) For the Select control it has two parameters called From and To; are these numerical markers for the table grid or are they text strings?  How do I declare what item for the Select command to, er, select?

Just a little lost on the syntax here as the documentation is a bit...vague.

HP Officejet Pro 8600 Illustrated.jpg

Share this post

Link to post
Share on other sites


i've never used ControlListView before, so here is what i did:

opened the example for GuiCtrlCreateListView(), compiled it to exe, run it. now i have a well-known GUI with a listview that i can work with:


then i used this command:

ControlListView('listview items', '', 'SysListView321', 'Select', 1)

the result:


the index for the Select command is zero-based, i.e. index 0 means the 1st item, index 1 is the 2nd item.

the index for subitem is also zero-based. "item" means row, "subitem" means column. this is mentioned in the help for ControlListView().

read the help carefully, and you are ready to take it from here.


Edited by orbs

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