Jump to content

ControlCommand ListBox question


Cave
 Share

Recommended Posts

I am somewhat new to AutoIT scripting... I've written a few scripts that work well but I am having trouble getting the controlcommand function to work with the "SelectString" argument to select an item in a ListBox. Here is the snipet of my script:

WinWaitActive("Select State(s) to Process")

ControlFocus("Select State(s) to Process","",1008)

ControlCommand("Select State(s) to Process","",1008,"SelectString",'ALASKA')

1008 represents the ControlID of "ListBox1" according to the AutoIT active window utility. When I run this script the Control Focus works but "ALASKA" is not selected from the ListBox of states.

Any help would be greatly appreciated! Eventually I want to replace 'ALASKA' in the function with a variable that is obtained from a user response, but I think I can figure that part out on my own....

Thanks!!

Link to comment
Share on other sites

  • Moderators

Have you tried using the ClassNameNN instead of the ControlID?

Edit:

I really don't see where that would change anything to be honest, so I'll ask this... is the listbox from a standard windows application, and 2.. are we sure that our title is 100% accurate?

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Have you tried using the ClassNameNN instead of the ControlID?

Edit:

I really don't see where that would change anything to be honest, so I'll ask this... is the listbox from a standard windows application, and 2.. are we sure that our title is 100% accurate?

You are correct; using the ClassNameNN had no effect. I am sure the title is 100% accurate. I copied it from other command functions on that listbox that seem to work (arrow up, down, etc). The listbox is from a "home grown" windows application that we developed from the ground up by our internal MIS software Dept. It is an application written in C++. I don't know anything about the code, but it looks and functions like a standard Windows app to me. The ClassNameNN is "ListBox1" - doesn't that indicate a standard Windows listbox??

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...