Sign in to follow this  
Followers 0
Erlend

ControlClick - OK Buttons

8 posts in this topic

Hello after som great help from Helge

i got to this:

Opt("TrayIconDebug", 1)

$title = "Installasjonsveiviser for trådløst nettverk"

Run("C:\SetupSNK.exe")

WinWait($title, "Vil du legge denne datamaskinen til det trådløse nettverket TEST1?")
ControlClick($title, "Vil du legge denne datamaskinen til det trådløse nettverket TEST1?", 1)
WinWait($title, "Datamaskinen har blitt lagt til i det trådløse nettverket TEST1")
ControlClick($title, "Datamaskinen har blitt lagt til i det trådløse nettverket TEST1", 2)

the topic is located here: http://www.autoitscript.com/forum/index.ph...c=37279&pid

Can somone help me with this script?

Thanks ;)

Share this post


Link to post
Share on other sites



How did yu get the numbers 1 and 2?

Did you use au3info.exe? Or maybe get the script written with AU3Record.exe. Au3Info is in the AutoIt installation. If I recall right AU3Record.exe can be downloaded separately. It is also bundled with Scite4AutoIt.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What was the point of starting a new topic? Multiple threads for the same problem are unnecessary...

As for your problem, try using other forms of the Control, ClassNameNN or Text. ie. try "OK" or "Button1"

Edit: typo

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

per help..

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 a href="."/intro/controls.htm">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.

so...

ControlClick($title, "Vil du legge denne datamaskinen til det trådløse nettverket TEST1?", 1)

is the control name "1"

get control info from AutoitInfo Tool, on your computer press...

start > All Programs > AutoIt v3 > Autoit Window Info

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

info from Active Windows Info:

Sorry for starting a new topic..... ;)

Dialog 1:

Press CTRL-ALT-F to freeze the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:  Installasjonsveiviser for trådløst nettverk
Class:  #32770
Size:   X: 182  Y: 325  W: 401  H: 119

>>>>>>>>>>> Mouse Details <<<<<<<<<<<
Screen: X: 353  Y: 412
Cursor ID:  2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<
RGB:    Hex: 0xD6D3CE   Dec: 14078926

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<
Size:       X: 119  Y: 60   W: 75   H: 23
Control ID: 1
ClassNameNN:    Button1
Text:       OK
Style:      0x50030001
ExStyle:        0x00000004

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


>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
OK
Avbryt
Vil du legge denne datamaskinen til i det trådløse nettverket TEST1?

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

Dialog 2:

Press CTRL-ALT-F to freeze the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:  Installasjonsveiviser for trådløst nettverk
Class:  #32770
Size:   X: 249  Y: 361  W: 324  H: 100

>>>>>>>>>>> Mouse Details <<<<<<<<<<<
Screen: X: 426  Y: 433
Cursor ID:  2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<
RGB:    Hex: 0xD6D3CE   Dec: 14078926

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<
Size:       X: 122  Y: 41   W: 75   H: 23
Control ID: 2
ClassNameNN:    Button1
Text:       OK
Style:      0x50030001
ExStyle:        0x00000004

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


>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
OK
Datamaskinen har blitt lagt til i det trådløse nettverket TEST1.

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

Share this post


Link to post
Share on other sites

try using other forms of the Control, ClassNameNN or Text. ie. try "OK" or "Button1"


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

OK, like this?:

Opt("TrayIconDebug", 1)

$title = "Installasjonsveiviser for trådløst nettverk"

Run("C:\SetupSNK.exe")

WinWait($title, "Vil du legge denne datamaskinen til det trådløse nettverket TEST1?")

ControlClick($title, "Vil du legge denne datamaskinen til det trådløse nettverket TEST1?", 1, "OK")

WinWait($title, "Datamaskinen har blitt lagt til i det trådløse nettverket TEST1")

ControlClick($title, "Datamaskinen har blitt lagt til i det trådløse nettverket TEST1", 2, "OK")

Share this post


Link to post
Share on other sites

thanks Larry for the wakup call :lmao: zzzzz works now ;)

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