Hi All,

I have an app that starts up an other windowed app using createprocess. Now
when it's time to close i want the other app to close too. How would i do
that?

I also would like to know if the other app got closed (basicly crashed
:-) ), Is there a way to monitor a process if it's still alive?

Thanks in advance,
Richard.

Re: Closing a process(windows app) created with createprocess. by Alex

Alex
Tue May 11 10:58:32 CDT 2004

You can use toolhelp to enumerate the processes. Do it in a loop evey, say,
100 msec, and wait for the target process to disappear. Just so long as you
do not leave like that - or it'll eat the battery

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Richard" <rh@xs4all.nl> wrote in message
news:eimCO82NEHA.3556@TK2MSFTNGP09.phx.gbl...
> Hi All,
>
> I have an app that starts up an other windowed app using createprocess.
Now
> when it's time to close i want the other app to close too. How would i do
> that?
>
> I also would like to know if the other app got closed (basicly crashed
> :-) ), Is there a way to monitor a process if it's still alive?
>
> Thanks in advance,
> Richard.
>
>



Re: Closing a process(windows app) created with createprocess. by Alex

Alex
Tue May 11 10:59:10 CDT 2004

The toolhelp.dll could be your friend:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/ProcessManager.asp?frame=true

--
--
Alex Yakhnin .NET CF MVP
www.intelliprog.com | www.opennetcf.org

"Richard" <rh@xs4all.nl> wrote in message
news:eimCO82NEHA.3556@TK2MSFTNGP09.phx.gbl...
> Hi All,
>
> I have an app that starts up an other windowed app using createprocess.
Now
> when it's time to close i want the other app to close too. How would i do
> that?
>
> I also would like to know if the other app got closed (basicly crashed
> :-) ), Is there a way to monitor a process if it's still alive?
>
> Thanks in advance,
> Richard.
>
>



Re: Closing a process(windows app) created with createprocess. by Paul

Paul
Tue May 11 11:19:54 CDT 2004

You can wait for a process to exit using WaitForSingleObject (P/Invoke) on
the process handle returned from CreateProcess. If you do that with a
time-out on the Wait, you can decide that, after 20 seconds, if the wait has
not completed, the process is hung and do something about it.

Paul T.

"Richard" <rh@xs4all.nl> wrote in message
news:eimCO82NEHA.3556@TK2MSFTNGP09.phx.gbl...
> Hi All,
>
> I have an app that starts up an other windowed app using createprocess.
Now
> when it's time to close i want the other app to close too. How would i do
> that?
>
> I also would like to know if the other app got closed (basicly crashed
> :-) ), Is there a way to monitor a process if it's still alive?
>
> Thanks in advance,
> Richard.
>
>