Sign in to follow this  
Followers 0
Falling

Can you use If's on Windows creations?

5 posts in this topic

Like : I click a button. Then..

If WindowA appears then...

elseif WindowB appears then...

-----------------

I have tried a few things. Like if (winwait (...)) Did not seem to work

Share this post


Link to post
Share on other sites



$wait= WinWait("title","", 5); 5 secs.
If $wait=1 Then...

This is what i was trying to do. Just seems so weird not having it in a function.

This is how i'd assume I'd check two windows.

Func WhichWindow($name1, $name2); 

  $window1 = WinWait($name1,"", 5); 5 secs. 
  $window2 = WinWait($name2,"", 5); 5 secs.

  If $window1 == $window2 Then
     Return 0;  None are true.
  EndIf

  If $window1 = 1
    Return 1;  $name1 is true

  Else
    Return 2;  $name2 is true
  EndIf

EndFunc

; example -> $whatnext = WhichWindow("Bank1menu", "Bank2menu")
; then u can use a switch case on what is next... etc.

Share this post


Link to post
Share on other sites

hah..or i guess i could just use WinExists ( "title" [, "text"] )

.......

darn u help file.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This is what I do

While 1
   If WinActive("Title", "Text") Then
      Do Something
      ExitLoop
  ElseIf WinActive("Title2","Text2") Then
      Do Something Else
      ExitLoop
   EndIf
   Sleep(250)
Wend

or

While 1
   If WinActive("Title", "Text") Then
      Do Something
      ExitLoop
   EndIf
   If WinActive("Title2","Text2") Then
      Do Something Else
      ExitLoop
   EndIf
   Sleep(250)
Wend
Edited by w_sp8er

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  
Followers 0