C
Chris
Hello,
I have a Windows Forms application which has buttons to click to run
other programs.
One of the applications it must run is a ClickOnce Windows Forms
application, so the Application Reference in the start menu is the only
way to access it.
I have the following code used to start the other program:
System.Diagnostics.Process _proc;
string ExecutableName;
ExecutableName = "C:\\Documents and
Settings\\User\\Start Menu\\Programs\\App1\\App1.appref-ms";
_proc = new System.Diagnostics.Process();
_proc.StartInfo.FileName = ExecutableName;
_proc.StartInfo.UseShellExecute = true;
_proc.StartInfo.WindowStyle =
ProcessWindowStyle.Normal;
_proc.Start();
It DOES successfully start the application. The original Forms
Application must WAIT on the other program, so I added the following
line:
_proc.WaitForExit();
When it executes that line, I get an Exception "No process is
associated with this object".
If I execute an old VB6 application instead of the ClickOnce
application, _proc contains valid information and the WaitForExit works
fine. What is the problem here?
One thing I have noticed is that the ClickOnce application only shows
up in Task Manager under the Processes window, not the Application
window. I also tried adding a call to Process.GetProcesses() to see
all the processes on the system. I do NOT see that process in the
array returned. Should I see a process with the name of App1.exe?
Thanks for the help,
Chris
I have a Windows Forms application which has buttons to click to run
other programs.
One of the applications it must run is a ClickOnce Windows Forms
application, so the Application Reference in the start menu is the only
way to access it.
I have the following code used to start the other program:
System.Diagnostics.Process _proc;
string ExecutableName;
ExecutableName = "C:\\Documents and
Settings\\User\\Start Menu\\Programs\\App1\\App1.appref-ms";
_proc = new System.Diagnostics.Process();
_proc.StartInfo.FileName = ExecutableName;
_proc.StartInfo.UseShellExecute = true;
_proc.StartInfo.WindowStyle =
ProcessWindowStyle.Normal;
_proc.Start();
It DOES successfully start the application. The original Forms
Application must WAIT on the other program, so I added the following
line:
_proc.WaitForExit();
When it executes that line, I get an Exception "No process is
associated with this object".
If I execute an old VB6 application instead of the ClickOnce
application, _proc contains valid information and the WaitForExit works
fine. What is the problem here?
One thing I have noticed is that the ClickOnce application only shows
up in Task Manager under the Processes window, not the Application
window. I also tried adding a call to Process.GetProcesses() to see
all the processes on the system. I do NOT see that process in the
array returned. Should I see a process with the name of App1.exe?
Thanks for the help,
Chris