You might also take a look at the approach which takes advantage of WMI 
described more here: 
http://stackoverflow.com/questions/760904/how-can-i-monitor-a-windows-directory-for-changes.

Steve


On 1/22/2015 9:08 AM, LBX wrote:
> Dave,
>      This will check it at the 5 minute mark.
>
> Sample Format:
>    StartTimer 250, "SetFocus", dObj.Control( dID )
> Your Format:
>    StartTimer 50000, "CheckForState"
> Sub CheckForState()
> End Sub
>
> Sent: Thursday, January 22, 2015 6:05 AM
> Subject: Think I could need a bit of help...
>
>
> Scripters,
> In one of my projects, I need some routine to check a certain state of
> things, with given intervals. This should be done in the background,
> with as little interference with the user's activity, as possible. Let's
> for instance say, you want to check if a file has been updated, and you
> want to do that every 5 minutes, all through the day.
>
> OK, I have one idea, but wanted to know if the WE API gives a better
> solution, and if so, could someone please point me to some code or the
> like, that illustrates how to implement. Here is the idea I have, but
> not sure if it is all that waterproof, or if it holds any chance of
> malfunctioning the app.
>
> Sub CheckForState()
>       Sleep 5000     'Let's just give it five seconds interval.
>       ' code activity goes here...
>       CheckForState()
> End Sub 'ChackForState.
>
> In other words, a simple, recursive sub, that will keep running all till
> the app closes. Yet, what if I need to end it from running, at any given
> state throughout the app execution? Like I said, not sure if this is the
> best and most smooth way to handle this task, so if anyone has a better
> idea, I am all ears.
>
> Thanks,
>

Reply via email to