Jump to content
Sign in to follow this  
strate

Arrays and WinWaitActive

Recommended Posts

strate

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
John

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
strate

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.