dinesh_bali
asked on
Response from System.Diagnostics.Process.Start
Hi,
I am using .Net 2005 and I am working on Windows application
If I am calling any other application from my application using
System.Diagnostics.Process .Start(App lication.S tartupPath + @"\Decrypt\vb_passwordDcry pt.exe");
This is starting my application made in .Net 2003
I want that when this application exists then I must know, that the application I opened is closed now
Can I find this in my application
Kind Regards,
I am using .Net 2005 and I am working on Windows application
If I am calling any other application from my application using
System.Diagnostics.Process
This is starting my application made in .Net 2003
I want that when this application exists then I must know, that the application I opened is closed now
Can I find this in my application
Kind Regards,
ASKER
Thanks for your response.
Can I get from process that the process is completed and now I can continue with my task even if process is not killed.
Many thanks once again
You can also do it with an event.
FProcess.EnableRaisingEven ts=true;
And then
private void FProcess_Exited(object sender, System.EventArgs e)
{
}
Make sure that you have a delegate event handler set up
e.g.
in a form
this.FProcess.Synchronizin gObject = this;
this.FProcess.Exited += new System.EventHandler(this.F Process_Ex ited);
FProcess.EnableRaisingEven
And then
private void FProcess_Exited(object sender, System.EventArgs e)
{
}
Make sure that you have a delegate event handler set up
e.g.
in a form
this.FProcess.Synchronizin
this.FProcess.Exited += new System.EventHandler(this.F
ASKER
Hi,
I want to do something like this
if(FProcess.WaitForExit())
{
MessageBox.Show("Exited");
}//waits till it exists
if(FProcess.HasExited())
{
MessageBox.Show("has exited");
}
How to do this and also, this is error.
Can I get from process that the process is completed and now I can continue with my task even if process is not killed.
Many Thanks
I want to do something like this
if(FProcess.WaitForExit())
{
MessageBox.Show("Exited");
}//waits till it exists
if(FProcess.HasExited())
{
MessageBox.Show("has exited");
}
How to do this and also, this is error.
Can I get from process that the process is completed and now I can continue with my task even if process is not killed.
Many Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
private void FProcess_Exited(object sender, System.EventArgs e)
{
MessageBox.Show("Prcess has Exited");
}
{
MessageBox.Show("Prcess has Exited");
}
ASKER
Many Thanks
new System.Diagnostics.Process
FProcess.StartInfo.FileNam
FProcess.Start();
FProcess.Kill();//if u want to kill the other process
FProcess.WaitForExit() //waits till it exists
FProcess.HasExited // gets whether the other application has exited
and u get many other stuff under FProcess