By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,693 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,693 IT Pros & Developers. It's quick & easy.

Process.Exit event not being raised

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
"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

P: n/a
"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

P: n/a
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

P: n/a
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.