Home All Groups Group Topic Archive Search About

Waiting for a process/program to start

Author
10 Jan 2006 6:53 PM
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

Author
10 Jan 2006 9:25 PM
Chris
JN wrote:
> 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
Author
11 Jan 2006 1:34 PM
JN
Chris wrote:
Show quoteHide quote
> JN wrote:
>
>> 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
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?
Author
10 Jan 2006 9:49 PM
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

Show quoteHide quote
"JN" <JN@nospam.com> wrote in message news:43c402d3$1@news.sentex.net...
> 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