c# - Force one application to close when a different application has closed, then close itself -


so, i'm writing program, here's start of it!

namespace consoleapplication4 {     class program     {         static void main(string[] args)         {             system.diagnostics.process.start(@"c:\\windows\\ehome\\ehshell.exe");             system.diagnostics.process.start(@"e:\\xpadder\\wmc.xpaddercontroller");         }     } } 

all open 2 files. want wait until detects when ehshell.exe stops running , force program (in case xpadder) end well.

i've had code doing this, i'm not best @ c# , not 100% sure i'm looking for!

        var p1 = new processstartinfo         {             filename = atomicparsleyfile,             arguments = atomicparsleycommands,             windowstyle = processwindowstyle.hidden,             useshellexecute = false,             createnowindow = true,             redirectstandardoutput = true         };          var proc = new process { startinfo = p1 };          if (!proc.start())         {             throw new applicationexception("starting atomic parsley failed!");         }                      /*repeat above second process here */          console.writeline(proc.standardoutput.readtoend());          proc.waitforexit(); //run atomicparsley , wait exit                     proc2.kill(); 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -