Jump to content

ControlClick problems


 Share

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
    WEnd

    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.

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