Jump to content

Wait for one or another window


Dietmar
 Share

Recommended Posts

Hello i need help I´m searching for something like this:

http://www.autoitscript.com/forum/index.ph...c=32574&hl=

My problem with few words:

I use Autoit to update databases, since the progress is started i look at a progressbar.

When the update is done a Mesagebox popped up.

I use this winwait-function to wait for succesful update, so far so good.

But if something goes wrong the Message Box has another Title: ok=2614 / failure=2615

How can i use WinWait because the update-time is between 5min and 1h, and so won`t use sleeptimer ;):whistle:

Link to comment
Share on other sites

  • Moderators

If Not _WinWaitx('My Main Title', 'The other MsgBox Title', 'My Main Text', 'The MsgBox Text') Then
    ;do whatever you would do if the other MsgBox showed up
EndIf
;Now carry on here as normal

Func _WinWaitx($sTitle, $sOtherTitle, $sText = '', $sOtherText = '')
    Do
        Sleep(250)
    Until WinExists($sTitle, $sText) Or WinExists($sOtherTitle, $sOtherText)
    If WinExists($sTitle, $sText) Then Return 1
    If WinExists($sOtherText, $sText) Then Return SetError(1, 0, 0)
EndFunc

Edited by SmOke_N

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.

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