Jump to content

ControlClick on Button doesnt work


 Share

Recommended Posts

Hi,

i have a little Problem. 

I want to install a program without user interaction. The installer starts and AutoIT wait for the window to be active, but the button isn´t pushed. 

I used many variants of ControlClick to push it, but nothing worked. I used the Button-ID the name of it and so on.

Actual Source Code:

#include <MsgBoxConstants.au3>

$Title = "Installer Language"


Runas( "administrator" , "domain" , "password" , 0, "path" )
WinWaitActive($Title, "Please select a language.")
WinActivate($Title,"Please select a language.")


ControlClick($Title,"Please select a language.", "OK", "left")


;MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10)
;ControlClick ($Title, "" ,1 , 75 , 23 )
;Send("{ENTER}")

Au3Info Summary:

>>>> Window <<<<
Title:  Installer Language
Class:  #32770
Position:   813, 501
Size:   294, 157
Style:  0x94C808CC
ExStyle:    0x00010101
Handle: 0x0000000000EA050E

>>>> Control <<<<
Class:  Button
Instance:   1
ClassnameNN:    Button1
Name:   
Advanced (Class):   [CLASS:Button; INSTANCE:1]
ID: 1
Text:   OK
Position:   113, 96
Size:   75, 23
ControlClick Coords:    41, 12
Style:  0x50010001
ExStyle:    0x00000004
Handle: 0x00000000003E0C12

>>>> Mouse <<<<
Position:   970, 635
Cursor ID:  0
Color:  0xC9EAEA

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Deutsch
OK
Cancel
Please select a language.


>>>> Hidden Text <<<<

I don´t know what to do. Please help me.

Link to comment
Share on other sites

 

Try with just

ControlClick($Title, "", "Button1")
 or 
ControlClick("Installer Language", "", "Button1")

Edit: I see that your window has the same class as mine,  Class:   #32770. Not sure if it means anything, just find it interesting that it's the same class for the two windows, and we are both experiencing issues interacting with it.

Edited by AutoDub
Link to comment
Share on other sites

  • Developers

Dont think you can use Control???? Commands on a program running under different credentials.

Try running the whole script with a runas and use a run() command in the script.

Jos

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

First reshell your script with the right credentials and then do what you need to do.

You can use a commandline parameter to indicate the seconds stage.

Jos

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

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