Jump to content
Sign in to follow this  

ControlClick problems

Recommended Posts

Background: I'm using AutoIt to test some installation scripts on Windows XP running inside Virtual PC 2007 (running in windowed mode).

Problem: The ControlFocus and ControlClick commands are getting lost or ignored unless VPC is the active window and the (non-virtual) computer's load is minimal.

Solution: Brute Force­­

Func UberClick( $title, $text, $button, $tries = 10 )
    If Not WinExists($title, $text) Then Return 0

    Local $i = 0
    While (($i < $tries) And (WinExists($title, $text)))
        ControlFocus($title, $text, $button)
        ControlClick($title, $text, $button)
        $i += 1

    If WinExists($title, $text) Then Return 0

    Return $i
EndFuncoÝ÷ ØLZ^jëh×6UberClick("Marshmallow Fluff Installer", "&Next >", "[CLASS:Button; TEXT:&Next >]")

There were a few older posts about similar problems, but none of them seemed to be completely resolved. This seemed to work for me, and I hope it helps others.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...