I have a windows forms application (ItemInquiry.exe). I want to execute another windows forms application (ItemDownload.exe) and wait for that form to close.
My current code (In the calling application) looks like this:
private void menuFileItemDown_Click(object sender, EventArgs e)
{
System.Diagnostics.Process itemDownProcess =
new System.Diagnostics.Process();
itemDownProcess.StartInfo.FileName = "c:\bin\ItemDown.application";
//Click-Once application
itemDownProcess.Start();
itemDownProcess.WaitForExit();
loadItems();
}
loadItems executes immediately. I think that what is happening is that the .application file actually returns once it has loaded the (possibly updated) application.
Is there a way for the called application to notify the calling application that it has been closed short of using a semaphore?
Thanks