Sign in to follow this  
Followers 0
purpleblue

Control ID keeps changing

15 posts in this topic

Hi!

I try to automate the installation of some programms. My problem is, that everytime I run the setup, the 'Next'-Button gets a different Control ID. In the AutoIt help file its said, that using this ID is the best way to access single controls via the ControlClick-function. So is it normal for the ID to change or were's the point? ;)

BTW: I tried to search for postings concerning my problem, but the forum search won't let me use + and " in one statement :P

Thx a lot for your help!

Share this post


Link to post
Share on other sites



Hi!

I try to automate the installation of some programms. My problem is, that everytime I run the setup, the 'Next'-Button gets a different Control ID. In the AutoIt help file its said, that using this ID is the best way to access single controls via the ControlClick-function. So is it normal for the ID to change or were's the point? ;)

BTW: I tried to search for postings concerning my problem, but the forum search won't let me use + and " in one statement :P

Thx a lot for your help!

What is the exact information that AU3_Info.exe gives for this control ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What is the exact information that AU3_Info.exe gives for this control ?

For example during the installation of Protowall:

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Setup - ProtoWall

Class: TWizardForm

Size: X: 278 Y: 91 W: 501 H: 390

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 632 Y: 454

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xF6F6F2 Dec: 16185074

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 325 Y: 326 W: 75 H: 23

Control ID: 852204

ClassNameNN: TButton1

Text: &Next >

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Welcome

Welcome to the ProtoWall Setup Wizard

This will install ProtoWall 2.0 Beta on your computer.

It is recommended that you close all other applications before continuing.

Click Next to continue, or Cancel to exit Setup.

&Next >

Cancel

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

Main

SelectComponents

Full installation

InfoBefore

ProtoWall 2.0 Beta

====================================

IMPORTANT NOTE!

During installation, you will get three warning messages. Click "Continue Anyway" each time to complete the installation of ProtoWall.

For additional information, visit the following sites:

ProtoWall Help

http://www.bluetack.co.uk/pwhelp

Bluetack Forums

http://www.bluetack.co.uk/phpn2/index.php

What is ProtoWall?

If you p2p like I do, you cannot have enough security against prying eyes that have invaded the community. Drastic measures have been taken by the likes of the Riaa and Mpaa, as well as all the Sub-Contracted cronnies of the movie and record industry. Introducing their worst nightmare. "ProtoWall + The Bluetack Blocklist manager." ProtoWall Blocks incoming packets from Internet addresses that are on the Bluetack Blocklist. The Blocklist is supported Globally and then is sorted (Overlapping Resolved) and then converted to various formats (ProtoWall, PeerGuardian, Emule, ect.).

Please note that "Beta" means the application is not done. ProtoWall 2.0 can be judged properly when it goes final.

ProtoWall - Copyright© 2003-2004 by DudeZ. All rights reserved.

Starting the Setup another time brings:

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Setup - ProtoWall

Class: TWizardForm

Size: X: 217 Y: 72 W: 501 H: 390

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 570 Y: 434

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xF6F6F3 Dec: 16185075

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 325 Y: 326 W: 75 H: 23

Control ID: 1442002

ClassNameNN: TButton1

Text: &Next >

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Welcome

....

I know I could use the Send-funktion instead, but I though these IDs were constants ;)

Share this post


Link to post
Share on other sites

They are only constant in programs that do not dynamically create the gui at runtime. You can easily use "TButton1" or "&Next >", since this is what the average autoit user does anyway to make readability easier.


Who else would I be?

Share this post


Link to post
Share on other sites

They are only constant in programs that do not dynamically create the gui at runtime. You can easily use "TButton1" or "&Next >", since this is what the average autoit user does anyway to make readability easier.

Thx, I started doing so already. Its only that the descritption in the helpfile made me think, these ID did a better job somehow.

Share this post


Link to post
Share on other sites

Thx, I started doing so already. Its only that the descritption in the helpfile made me think, these ID did a better job somehow.

I am nearly always using the ClassName since that normally stays the same....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thx, I started doing so already. Its only that the descritption in the helpfile made me think, these ID did a better job somehow.

Hey purpleblue, ya I know what you mean, in the helpfile it shows this > ControlClick ( "title", "text", controlID [, button] [, clicks]] )

Parameters

title The title of the window to access.

text The text of the window to access.

controlID The control to interact with. See Controls.

button [optional] The button to click, "left", "right" or "middle". Default is the left button.

clicks optional] The number of times to click the mouse. Default is 1.

... nothing about ClassNameNN. It took me a while to figure this out also. It would definely help us newbs if the different id's that could be used were spelled out. (maybe it was... only we missed it?) Regardless, so far I LOVE Autoit! Thanx Jon et al!

Share this post


Link to post
Share on other sites

Welcome to the forums Mikey!

Just for anyone who also wonders, the link included with the explanation for controlID (which shows this page) explains all of the types of information that can be used there (control ID, ClassNameNN, text and control handle). ;)

Share this post


Link to post
Share on other sites

what can you do if the ClassName is blank?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

I doubt that the ClassNameNN would ever be blank because as far as I can tell, AutoIt 'creates' this way of identifying controls for each control.

In such an event you would probably need to resort to _ControlGetHandleByPos().

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

AutoIt 'creates'

AutoIt does no such thing. The "classnameNN" is a composite construct. The "classname" part is the class name of the control used in the CreateWindow() API call. The "NN" part is a number AutoIt uses to distinguish individual instances of the same type of control. Using the word "create" is a bit too strong of a word for what AutoIt actually does. "Builds" would perhaps be a better choice.

A blank classname means there is no control under the mouse.

Edited by Valik

Share this post


Link to post
Share on other sites

I doubt that the ClassNameNN would ever be blank because as far as I can tell, AutoIt 'creates' this way of identifying controls for each control.

The ClassName obviously originates from the controls in question but through the use of a numeric suffix, AutoIt does in fact create its own method for uniquely identifying those controls of a common class. Apologies to anyone who was misled by my drivel.

Share this post


Link to post
Share on other sites

So, what would one do when there is no text to distinguish the controls, the ControlID changes each time the window is opened, and the ClassnameNN changes when controls are manipulated?

For instance:

In a startup menu, a user has an option to do a variety of things, create a project, open a project, edit a photo, etc. If you look at the ClassnameNN of the Create Project button before you click it, it will say WindowsForms10.window.8.app711, but after you click on it, it will be WindowsForms10.window.8.app712, and WindowsForms10.window.8.app711 is assigned to another control on that same menu. The original classnameNN of WindowsForms10.window.8.app711 is never reassigned to the first command for the length of time that window is open.

Is there another way to identify these controls more specifically, and permanently?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

That would be when you consider manipulating controls via their positions.

Edit: I'm going to rewrite that function so you may want to watch that space.

Edited by LxP

Share this post


Link to post
Share on other sites

Awesome. I don't know if I'm going to have time this week to implement this and start working on that portion of things, but I will be very soon. Just getting busy with another project... but this one needs to be finished too. Or more finished :-P

Thanks for the help.

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