Waiting for a process/program to start

J

JN

Hello,

I am trying to write a program or service that will run in the
background and wait for a particular program to start, when it does I
want something else to occur such as a message box. I am not sure how to
do the waiting game (sleep is no good, neither is a loop).
Any help is appreciated.

JN
 
C

Chris

JN said:
Hello,

I am trying to write a program or service that will run in the
background and wait for a particular program to start, when it does I
want something else to occur such as a message box. I am not sure how to
do the waiting game (sleep is no good, neither is a loop).
Any help is appreciated.

JN

Why is sleep no good?

Chris
 
J

Jim Wooley

Why not do this asynchronously by firing the process to start on another
thread and passing the delegate of the method which will open the message
box when the process completes? There are differences in how you do this in
1.x vs 2.0, so make sure to research the right areas. There should be plenty
of examples for asynchronous programming available online and in the help
files.

Jim
 
J

JN

Chris said:
Why is sleep no good?

Chris
What I am trying to do is have this program monitor what programs are
being used and once a particular one is started, I would like a message
box to open. If I cause this program to sleep it may miss the starting
of a program, I am correct in this thinking?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top