Sign in to follow this  
Followers 0
Iznogoud

[ControlClick] How to click an field in MS AntiSpyware Beta

4 posts in this topic

#1 ·  Posted (edited)

I am writing executables wich will be executed after an unattended install of Windows Xp.

So i have a couple programs wich i wanna install automatically en update so it will be ready if everything is done.

So this is my problem:

My code

Run("C:\Microsoft AntiSpyware Beta\MicrosoftAntiSpywareInstall.exe")

; ---------------------- Installation of MS AntiSpyware ---------------------------------
WinWaitActive("Microsoft AntiSpyware", "powerful anti-spyware software that")
ControlClick("Microsoft AntiSpyware", "", "Button1")
WinWaitActive("Microsoft AntiSpyware", "license agreement")
ControlClick("Microsoft AntiSpyware", "", "Button3")
ControlClick("Microsoft AntiSpyware", "", "Button5")
WinWaitActive("Microsoft AntiSpyware", "Change to install to a different folder")
ControlClick("Microsoft AntiSpyware", "", "Button1")
WinWaitActive("Microsoft AntiSpyware", "wizard is ready to begin")
ControlClick("Microsoft AntiSpyware", "", "Button1")

WinWaitActive("Microsoft AntiSpyware", "Installation Complete")
ControlClick("Microsoft AntiSpyware", "", "Button5")
ControlClick("Microsoft AntiSpyware", "", "Button1")

; ---------------------- Updating of MS AntiSpyware ------------------------------------
WinWaitActive("Microsoft AntiSpyware (Beta 1)", "")
ControlClick("Microsoft AntiSpyware (Beta 1)", "", "ThunderRT6PictureBoxDC9")

WinWaitActive("Microsoft AntiSpyware AutoUpdater", "")
Sleep(10000)
ControlClick("Microsoft AntiSpyware (Beta 1)", "", "ThunderRT6UserControlDC4")

I have made a screenshot of the field i wanna click:

Posted Image

Wich commands can i use to click this field? Or does anyone already have a script wich can do this so i can study it and learn how you guys are using the good commands etc.

The problem in the code begins at:

..
; ---------------------- Updating of MS AntiSpyware ------------------------------------
WinWaitActive("Microsoft AntiSpyware (Beta 1)", "")
ControlClick("Microsoft AntiSpyware (Beta 1)", "", "ThunderRT6PictureBoxDC9")
..

I have used the WinWaitActive command and the correct classname, but it won't work. Do you guys have some idea?

Maybe you can say look for text "Spyware definitions" and click? or something like that. Sorry for my simple minded solutions ;)

Edited by Iznogoud

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Sorry for my simple minded solutions ;)

Forget Simple Minded. How about Brute Force? Add this code to your script just when you need to click on that "invisible" control:

$realsize = WinGetPos("Microsoft AntiSpyware")
    MouseClick("Left",$realsize[0]+107,$realsize[1]+425); Press Spyware Definitions link

Where 107 and 425 are the distance in x and y that your button is from the top left corner of the dialog box. (These numbers are correct --- I measured on my system).

It's easy to find this dimension by dragging the dialog box up into the top left corner of your screen and then, with AutoIT Info, check the exact x/y of the control. I do this all the time when I can't communicate with the interface (most Autodesk products)...

Edited by jefhal

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Forget Simple Minded. How about Brute Force? .... I do this all the time when I can't communicate with the interface (most Autodesk products)...

Good one jefhal

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hahahaha, i was woundering how people will do that with coordinates within a dialog box. Finally i know ;)

This will be handy for sure.

But the coordinates can be find also in the Active Windows info tool. If you use it you don't need to drag you active window to the upper left of your screen. Or am i wrong?

Edited by Iznogoud

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