ur Posted January 31, 2017 Posted January 31, 2017 (edited) With _WinWaitActivate we can wait for a window to process it. But is there any logic so that we can wait for this window title and based on the window text (like 2 or more patterns will be there) we can click yes or no on the window. Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc Edited January 31, 2017 by ur
ur Posted January 31, 2017 Author Posted January 31, 2017 More specifically, _WinWaitActivate($win1,"WARNING: This progra") Send("{SPACE}") _WinWaitActivate($win1,"I DISAGREE and &do n") Send("{UP}n") THe above logic will wait for first window and sends "Space" and wait for the second window. But I want logic like if any of the window in the above two appears, it should send the key based on the window. I mean parallel wait , but not sequential wait. Anyone please suggest.
Danyfirex Posted January 31, 2017 Posted January 31, 2017 Hello. You can do something like this. Local $iSecondsToWait = 3 Local $hTimer = TimerInit() Local $fDiff = 0 Local $sTitleWindow1="Window1" Local $sTitleWindow2="Window2" While True $fDiff = TimerDiff($hTimer) If $fDiff >= $iSecondsToWait * 1000 Then ConsoleWrite("TimeOut" & @CRLF) ;Do something ExitLoop EndIf If WinExists($sTitleWindow1) Then WinActivate($sTitleWindow1) ConsoleWrite("Window1 Found" & @CRLF) ;Do something ExitLoop EndIf If WinExists($sTitleWindow2) Then WinActivate($sTitleWindow2) ConsoleWrite("Window2 Found" & @CRLF) ;Do something ExitLoop EndIf WEnd Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now