Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Wait for any window change?


  • Please log in to reply
2 replies to this topic
Guesting
  • Guests
  • Last active:
  • Joined: --
I'm trying to write a script that will wait at the top of the loop for any window change. For example, if the user goes from Notepad to IE the loop will continue. I tried WinWaitActive with no parameters and SetTitleMatchMode 2 but haven't had any success. Any help?

Alpha Bravo
  • Members
  • 1687 posts
  • Last active: Nov 07 2015 03:06 PM
  • Joined: 01 Sep 2011
WinGetActiveTitle , CurrentTitle

SetTimer , CheckTitle, 1000

return



CheckTitle:

WinGetActiveTitle , Title

if (Title = CurrentTitle)

    return

CurrentTitle := Title

MsgBox , new window

return



Gogo
  • Guests
  • Last active:
  • Joined: --
Loop

   {

    WinWaitActive A        ; makes the active window to be the Last Found

    WinWaitNotActive       ; waits until the active window changes

    ; ...........

    SoundBeep, 750, 50

   }