Sign in to follow this  
Followers 0
strate

Arrays and WinWaitActive

3 posts in this topic

I have a program that I want to work only when a user has a window from a list of windows active. It is a program that will log the keypunches and screen images of the pc in use. I don't want it to log activity from other windows though, make sense?

I'd like it to pause execution of the loop until one of the windows is active.

I know this is easy I'm just being stupid.


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites



I have a program that I want to work only when a user has a window from a list of windows active. It is a program that will log the keypunches and screen images of the pc in use. I don't want it to log activity from other windows though, make sense?

I'd like it to pause execution of the loop until one of the windows is active.

I know this is easy I'm just being stupid.

While 1
If winactive($prog) then spyit()
sleep(100)
wend

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2) 
#include <Array.au3>
Dim $TESTARRAY[3]
$TESTARRAY[1] = 'Calculator'
$TESTARRAY[2] = 'Microsoft Excel'



While 1
    $Pos=_ArraySearch($TESTARRAY,WinGetTitle('',''))
    If $Pos = '' Then
        ToolTip($Pos&' Paused 1')
        While 2
            $Pos = _ArraySearch($TESTARRAY,WinGetTitle('',''))
            ToolTip(WinGetTitle('','')&' Paused 2')
            If $Pos <> '' Then
                ExitLoop
            EndIf
            Sleep(10)
        WEnd
    EndIf
    ToolTip(WinGetTitle('','')&' Not Paused')
    Sleep(10)
WEnd

This is it almost I need to do a little work on the title matching, help would be great.


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

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