WRH,
That should work perfectly. In order to get that event fired you need to set
EnableRaisingEv ents = true; I can see you did that.
My suggestion is to double check if this flag is set.
Another case where you may not get the event fired (I just want to make
clear that this is very unlikely and I don't believe this is your problem)
is because you set SynchronizingOb ject to the parent control. In this case
the code will try to marshal the event call to the UI thread. Internally
this is done using the windows message loop and it should work perfectly.
There might be a catch though. If the parent control is a user control for
example and the control is created using the *new* operator, but not added
to any Controls collection it might be possible that the message loop
doesn't serve these control or the control might be created in a worker
theread that has no message loop at all. Again this is very hypothetical,
but there are chances that you may recognize similar situation in your code.
--
HTH
Stoitcho Goutsev (100)
"WRH" <no*****@videot ron.ca> wrote in message
news:uY******** *****@tk2msftng p13.phx.gbl...
Hello
I used the VS designer to set up Process code as follows...
the problem is, although the process is executed, when
it is shut down I never get the Exited event.
...
private System.Diagnost ics.Process process1;
...
this.process1 = new System.Diagnost ics.Process();
...
// process1
//
this.process1.E nableRaisingEve nts = true;
this.process1.S ynchronizingObj ect = this;
this.process1.E xited += new System.EventHan dler(this.proce ss1_Exited);
...
process1.StartI nfo.FileName = @"F:\G\MS Paint";
process1.Start( );
...
private void process1_Exited (object sender, System.EventArg s e)
{
MessageBox.Show ("Exited");
}