Launch External Program

  • Thread starter Thread starter Glenn Palomar
  • Start date Start date
G

Glenn Palomar

Hi,

How will you know if an external program has launched successfully? I'm
trying to use System.Diagnostics.Process class.

I know that you can check if the process has exited but can you tell if it
has launched it successfully?

Thanks,
Glenn
 
Well.. usually, if the process hasn't exited, then it's running! I guess in
your case, that's not the case :D

There's Process.Responding, which will tell you is the process is "active"
in the eyes of the OS.
I think that's all that could be useful.
Which process are you needing to know about??
__________________________________________________
The Grim Reaper
 
I wanted my application to block until it has loaded the external
application (Inventor).

I guess I can put it in a while loop and wait until I get something when I
call Marshal.GetActiveObject.
 
Glenn Palomar said:
How will you know if an external program has launched successfully? I'm
trying to use System.Diagnostics.Process class.

I know that you can check if the process has exited but can you tell if it
has launched it successfully?

I assume an exception is thrown if the file cannot be found, for example.
In addition you may waht to check the exit code returned by the started
application:

\\\
Dim p As Process = Process.Start(...)
p.WaitForExit()
MsgBox(p.ExitCode)
///
 
Back
Top