Sign in to follow this  
Followers 0
twinnis

Problems with ControlClick in ntbackup wizard

5 posts in this topic

Hi.

I am trying to automate ntbackup via GUI and not the commandline. But problems start early. The Controlclick dont work at the first window. I am wondering if there could be a problem because I am using Swedish OS Windows XP Pro? Can it be the characters Å, Ä, Ö or is it because the control is hidden?

The AUtoIt window info show:

Press CTRL-ALT-F to pause the display.

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

Title: Guiden Säkerhetskopiera eller återställ

Class: #32770

Size: X: 259 Y: 177 W: 506 H: 386

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

Window: X: 380 Y: 362

Cursor ID: 2

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

RGB: Hex: 0xD4D0C8 Dec: 13947080

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

Size: X: 327 Y: 327 W: 78 H: 23

Control ID: 12325

ClassNameNN: Button4

Text: Slutför

(Control is hidden)

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

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

Välkommen till guiden Säkerhetskopiera eller återställ

Den här guiden hjälper dig säkerhetskopiera eller återställa filer och inställningar på din dator.

Om du vill kan du växla till <a>avancerat läge</a> och ändra inställningar för säkerhetskopiering eller återställning. Detta rekommenderas endast för avancerade användare.

&Starta alltid i guideläge

Klicka på Nästa om du vill fortsätta.

< &Föregående

&Nästa >

Avb script:

RunWait("ntbackup.exe")

ControlClick("Guiden Säkerhetskopiera eller återställ", "Klicka på Nästa om du vill fortsätta.", 12325)

The weird thing is that the text on the button is &Nästa > but as you can se in the Window info it shows

Text: Slutför

Nästa in Swedish means Next and Slutför means Finish.

Is there anybody who can help me?

Thanks in advance.

/Twinnis

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If ControlCommand("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4', 'IsVisible', '') Then ControlClick("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4')

Edit: Added CodeBox :lmao:

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

If ControlCommand("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4', 'IsVisible', '') Then ControlClick("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4')

Edit: Added CodeBox :lmao:

Thanks for your answer SmOke_N.

But it still doesn´t work.

Any other ideas?

/Twinnis

Share this post


Link to post
Share on other sites

Hi.

I still havent solved the problem with AutoIt. But I guess that there is some problem with the Swedish characters because the script hang before it tries to send any mouseclicks. Its intressting that it works with VBScript as follows.

Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run "ntbackup.exe"

Do Until Success = True

Success = objShell.AppActivate("Guiden Säkerhetskopiera eller återställ")

Wscript.Sleep 1000

Loop

objShell.Sendkeys "%n"

But I dont know how to click on radiobuttons with VB.

Is there anyone that have any ideas on howe to solve this? I would be very grateful.

Thanks!

Best regards

Twinnis

Share this post


Link to post
Share on other sites

Hi.

I still havent solved the problem with AutoIt. But I guess that there is some problem with the Swedish characters because the script hang before it tries to send any mouseclicks. Its intressting that it works with VBScript as follows.

Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run "ntbackup.exe"

Do Until Success = True

Success = objShell.AppActivate("Guiden Säkerhetskopiera eller återställ")

Wscript.Sleep 1000

Loop

objShell.Sendkeys "%n"

But I dont know how to click on radiobuttons with VB.

Is there anyone that have any ideas on howe to solve this? I would be very grateful.

Thanks!

Best regards

Twinnis

It seems to be RunWait that doesn´t work with ntbackup.exe and not the Swedish characters. Instead I used WinWaitActive and the script is working fine.

/Twinnis

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