Jump to content

Control ID keeps changing


Recommended Posts

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!

Link to comment
Share on other sites

  • Developers

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 ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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 ;)

Link to comment
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?
Link to comment
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.

Link to comment
Share on other sites

  • Developers

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....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

Link to comment
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). ;)

Link to comment
Share on other sites

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
Link to comment
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.
Link to comment
Share on other sites

  • 2 weeks later...

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?

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

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...