locked
parent child relationship And Processes RRS feed

  • Question

  • hi all,

    does any one know anything about binding a process or creating a process in another process?

    i have a process, and want to start another process in the first process, (or even thread)

    so that two processes have a kind of parent child relationship, when a parent process (first process) starts then the child process(second process) starts and when the first stops, the second also stops, please give me some sample code (in c#), thanks alot.

     

    Sunday, March 9, 2008 7:23 AM

Answers

  • This is the basics of what needs to be done to do this with a process.  Hope this helps.

     

    Process process;

     

    Form_Load(object sender, EventArgs e)

    {

    ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe")

    startInfo.Arguments = "www.northwindtraders.com"
    startInfo.WindowStyle = ProcessWindowStyle.Minimized

    process = Process.Start(startInfo)

    }

     

    Form_Closing(object sender, EventArgs e)

    {

    process.Close();

    }

    Sunday, March 9, 2008 1:53 PM