Jump to content

How to click a ClassNameNN


Recommended Posts

Is it possible to invoke a click on a specific ClassNameNN, since the ControlID changes constantly with every new run of the program ?

I find the ControlClick but it is useless, ain't there any ClassNameNNclick ? :">

Link to comment
Share on other sites

  • Developers

Is it possible to invoke a click on a specific ClassNameNN, since the ControlID changes constantly with every new run of the program ?

I find the ControlClick but it is useless, ain't there any ClassNameNNclick ?  :">

<{POST_SNAPBACK}>

You will notice that AU3Info gives you the text it can see on a control, for example on a Next button you might see the text &Next - the & indicates that the next letter is underlined and is common when working with menus and controls.  You can use this text to identify a control in place of the "ClassNameNN" if you like - however if many controls have the same text you will run into problems.

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

  • Developers

Well, unfortunatelly it's a graphical button (the 5 big graphical buttons on top of Ad-Aware)  :)

<{POST_SNAPBACK}>

Just started Adaware SE a couple of times but the ClassNameNN stay the same so you should be able to use them .....

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

Just started Adaware SE a couple of times but the ClassNameNN stay the same so you should be able to use them .....

<{POST_SNAPBACK}>

JdeB,

I understand that the ClassNameNN stays the same, unfortunatelly I don't know how to invoke a click onto the specific ClassnameNN (There's no text whatsoever, only a graphic ) :)

Is there anyway I can click on the 4th graphical button on the Ad-Aware program, besides using MouseMove's & MouseClick's ?

Link to comment
Share on other sites

  • Developers

JdeB,

I understand that the ClassNameNN stays the same, unfortunatelly I don't know how to invoke a click onto the specific ClassnameNN (There's no text whatsoever, only a graphic )  :)

Is there anyway I can click on the 4th graphical button on the Ad-Aware program, besides using MouseMove's & MouseClick's  ?

<{POST_SNAPBACK}>

Just put it in the controlclick command.

Here's an exaple that start adaware and clicks 'Scan Now" and then "Next"...

Opt("WinDetectHiddenText", 1)
Run("C:\Program Files\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe")
WinWait("Ad-Aware SE Personal","Definitions File Loaded")
ControlClick("Ad-Aware SE Personal","Definitions File Loaded","TACimage11")
sleep(200)
ControlClick("Ad-Aware SE Personal","Definitions File Loaded","TACimage16")

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

  • 2 months later...

The searchfunction did its work again  :(  Needed this to.

But got one more question, I can't seem to find a thing to wait for to see when scanning is finished.

Any ideas?

<{POST_SNAPBACK}>

Read about PixelGetColor, PixelCoordMode and WinMove in the help file.

Open the AutoIt Window tool.

Within that tool, go to the Options, Coord Mode and set it to window.

Start AdAware

Start a scan

Place cursor on the middle of the red X

wait for the AutoIt window tool to update and then

freeze the AutoIt window tool via ctrl-alt-F

Note the "Dec:" pixel color

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

and the x,y position of the mouse

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

and the window size

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

Use WinMove to make sure that the AdAware window is the same size that it is when you gathered the color and x,y location of the center of the red X on the cancel button.

PixelCoordMode... ; put this at top of your script

WinMove...

;

;put the code to start the scan up here

;

;wait for the cancel button to show up

Do

Sleep(100)

Until PixelGetColor (x,y) = 14078926 ;<<<<<sample value

;wait for the cancel button to go away

While PixelGetColor (x,y) = 14078926 ;<<<<<sample value

Sleep(100)

WEnd

Maybe something like the pseudo-code above will work for you - maybe not.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

as expected it worked of course

Thanks for your help Herewasplato

<{POST_SNAPBACK}>

You are welcome... glad it worked for you.

Now you can work on a silent* update of the definitions file.

http://updates.ls-servers.com/public/defs.ref

or

http://download.lavasoft.de.edgesuite.net/public/defs.ref

Have a look around http://updates.ls-servers.com/public/

*as in not using the Ad-Aware GUI

Perhaps AutoiIt's InetGet along with Windows' "Scheduled Tasks"

later

[size="1"][font="Arial"].[u].[/u][/font][/size]

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