Sign in to follow this  
Followers 0
Ravenlark

Finding Controls in a Window

8 posts in this topic

#1 ·  Posted (edited)

I'm looking to make a script that will allow people to create automated installations by going through a series of dialogs.

I'm hung up on being able to determine what controls are available on a given window. If I use WinGetClassList, it usually can only return Button and Static.

Is there any way to determine what controls are available in a window programmatically?

Thanks for the input.

Edited by Ravenlark

Ravenlark-----------------------------------------------------when you find yourself with the majority, its time to pause and reflect - Mark Twain

Share this post


Link to post
Share on other sites



I'm looking to make a script that will allow people to create automated installations by going through a series of dialogs.

I'm hung up on being able to determine what controls are available on a given window. If I use WinGetClassList, it usually can only return Button and Static.

Is there any way to determine what controls are available in a window programmatically?

Thanks for the input.

AutoIT ships with a tool called "AutoIT Window Info", which is Au3Info.exe. That presents you with the information, but does not programaticly capture it for you. However, since it is itself a compiled AutoIT script, I believe you could crack it open and check out the secrets of AutoIT-Fu hidden inside... :whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/forum/index.ph...st&p=218527

http://www.autoitscript.com/forum/index.ph...st&p=205832

If you're trying to get them without using AutoItInfo ahead of time, you could be in for a world of pain... however, these are some options that do it by position that you could mod to do what you want.


[center]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.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

http://www.autoitscript.com/forum/index.ph...st&p=218527

http://www.autoitscript.com/forum/index.ph...st&p=205832

If you're trying to get them without using AutoItInfo ahead of time, you could be in for a world of pain... however, these are some options that do it by position that you could mod to do what you want.

I am in for a world of pain I imagine.

The problem is, the purpose of the script is the be able to create an automated installation for any application, so I will have no way of knowing where the controls might be on any given form. I can have the user select the correct window name, but I haven't figured out how to present a list of the avalable controls.

Looking at AutoIt info was a good idea, but it does not seem to allow decompilation; is it actually a compiled AutoIt? If so, is there anywhere I could get a look at the source, or at least the control detection functions?

I'm really trying to avoid the need for a more heavy duty language to read the window values, as I am not very good with C# yet, and thats the only heavy duty language I know.

Edited by Ravenlark

Ravenlark-----------------------------------------------------when you find yourself with the majority, its time to pause and reflect - Mark Twain

Share this post


Link to post
Share on other sites

I think you're way off here... AutoInfo is for you to get the ControlID's and or ClassNamesNN to use, so that no matter where they are you can use the Control* functions in the help file and still be able to interact with them.


[center]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.[/center]

Share this post


Link to post
Share on other sites
Scite4AutoIt3 has AutoItMacroGenerator in it that records installations by clicking on the window titles and then clicking the controls. I prefer to run it standalone without stdout option so I can see it record the code as using it. i also added it to my CMenu app to make life easier as it is mostly installer orientated.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I think you're way off here... AutoInfo is for you to get the ControlID's and or ClassNamesNN to use, so that no matter where they are you can use the Control* functions in the help file and still be able to interact with them.

I understand that SmOke_N; sorry if I am not being clear.

Does AutoIt Info need the co-ordinates of a control (which it obtains from the mouse position) to detect the control on the window?

Let me give you a more specific example of what I am trying to do.

User launches an installation program, say to install PONG arcade. The script gets the user to select the Window name from a list, so I have the name of the window.

On the first window of the PONG installer, there is a Next button and a Cancel button for example. How do I get my script to detect that there is a Next and Cancel button in that window? Keep in mind that this is for any installation program, so I have no knowledge of what controls might be available beforehand.

Does this make more sense?

Thanks for your insight.

Edited by Ravenlark

Ravenlark-----------------------------------------------------when you find yourself with the majority, its time to pause and reflect - Mark Twain

Share this post


Link to post
Share on other sites

Looking at AutoIt info was a good idea, but it does not seem to allow decompilation; is it actually a compiled AutoIt? If so, is there anywhere I could get a look at the source, or at least the control detection functions?

Unfortunately, looking at AutoIT Info was a mistaken idea... I asked and it turns out AutoIT Info is a compiled binary written in C++, not a demonstration of other-worldly AutoIT-Fu skills. I was mistaken in my earlier recommendation... sorry! :">


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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