471,624 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,624 software developers and data experts.

Process.Exit event not being raised

Hi there,

I'm running a process object within a .NET app, very simple, the process
is declared with events, i'm handling the Exit event and running a win32
application. No matter how the process closes the event is never raised, is
this because it is a win32 app rather than .NET? I've tried closing,
killing, and even sending a WM_CLOSE event to the window, it closes but no
event is raised.

My only other solution was to keep monitoring the HasExited property on
a background thread but I would rather use the event as that is what it was
created for. Thanks in advance if anyone has any advice on this!

--
Nick Pateman

---------------------------------------------------------------
Any views expressed above are my own
Without predjudice
Nov 21 '05 #1
4 3198
"Nick" <no****@altavente.com> schrieb
Hi there,

I'm running a process object within a .NET app, very simple, the
process
is declared with events, i'm handling the Exit event and running a
win32 application. No matter how the process closes the event is
never raised, is this because it is a win32 app rather than .NET?
I've tried closing, killing, and even sending a WM_CLOSE event to
the window, it closes but no event is raised.

My only other solution was to keep monitoring the HasExited
property on
a background thread but I would rather use the event as that is what
it was created for. Thanks in advance if anyone has any advice on
this!

Did you set the process' EnableRaisingEvents property?
Armin
Nov 21 '05 #2
"Nick" <no****@altavente.com> schrieb:
I'm running a process object within a .NET app, very simple, the
process is declared with events, i'm handling the Exit event and running a
win32 application. No matter how the process closes the event is never
raised, is this because it is a win32 app rather than .NET? I've tried
closing, killing, and even sending a WM_CLOSE event to the window, it
closes but no event is raised.


Make sure your process object's 'EnableRaisingEvents' property is set to
true. Alternatively you can start a new thread which starts the other
application and calls the process object's 'WaitForExit' method afterwards.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
Hi there,

Not to worry, I'm calling the WaitForExit method in a separate thread to
get around the problem.

Nick.

"Nick" <no****@altavente.com> wrote in message
news:ec**************@tk2msftngp13.phx.gbl...
Hi there,

I'm running a process object within a .NET app, very simple, the
process is declared with events, i'm handling the Exit event and running a
win32 application. No matter how the process closes the event is never
raised, is this because it is a win32 app rather than .NET? I've tried
closing, killing, and even sending a WM_CLOSE event to the window, it
closes but no event is raised.

My only other solution was to keep monitoring the HasExited property on
a background thread but I would rather use the event as that is what it
was created for. Thanks in advance if anyone has any advice on this!

--
Nick Pateman

---------------------------------------------------------------
Any views expressed above are my own
Without predjudice

Nov 21 '05 #4
Hi Herfried,

Sorry for the delay my pc only got the message today! Anyway's not to
worry now as I have a nice working solution :-) Thanks for your and Armin's
help.

Nick.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl...
"Nick" <no****@altavente.com> schrieb:
I'm running a process object within a .NET app, very simple, the
process is declared with events, i'm handling the Exit event and running
a win32 application. No matter how the process closes the event is never
raised, is this because it is a win32 app rather than .NET? I've tried
closing, killing, and even sending a WM_CLOSE event to the window, it
closes but no event is raised.


Make sure your process object's 'EnableRaisingEvents' property is set to
true. Alternatively you can start a new thread which starts the other
application and calls the process object's 'WaitForExit' method
afterwards.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Peter Åstrand | last post: by
77 posts views Thread by Charles Law | last post: by
18 posts views Thread by jas | last post: by
19 posts views Thread by Daniela Roman | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.