Jump to content
Sign in to follow this  

Wait for one or another window

Recommended Posts

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


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:

Share this post

Link to post
Share on other sites

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
;Now carry on here as normal

Func _WinWaitx($sTitle, $sOtherTitle, $sText = '', $sOtherText = '')
    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)

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.

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  

  • Create New...