PDA

View Full Version : timer actions


dulux1309
10-04-2004, 05:59 AM
Hi all,

I have a small app that i am writing that uses enumerate process to see if a particular program is running, and performs an action when it stops.

This works by checking that the process is started by clicking a button, but I think i need a timer to keep polling to see when the application is no longer running. Can anybody give me a clue as to how to do this? I have looked at some of the timer options and am struggling to see how to implement this.

thanks in advance.

rhosk
10-04-2004, 06:46 AM
Just start your timer, for example, at the On Show event -

Page.StartTimer(1000);

Then in the On Timer event, put your code that you want after the conditions are met - this is in the help file -

instances_of_file = 0;
file_to_check_for = "yourprocess.exe";
processes = Window.EnumerateProcesses();

for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
--fire your event here
end
end

Many ways to do this, but this way will do the trick. HTH.

dulux1309
10-04-2004, 06:53 AM
nice one. I kinda hacked out some code from the example and some of your previous good advice.

Thanks for your time.

Rich