Objectmix
Tags Register Mark Forums Read

Invoking System.Diagnostics.Process Start and changing the parent process : CSharp

This is a discussion on Invoking System.Diagnostics.Process Start and changing the parent process within the CSharp forums in Programming Languages category; Does anyone know if there's a means by which I can invoke a Process.Start, then detach the process from the calling process. I suppose in a nutshell I'm asking if there's a way I can add the new process to the "explorer" process. Thanks!...


Object Mix > Programming Languages > CSharp > Invoking System.Diagnostics.Process Start and changing the parent process

Reply

 

LinkBack Thread Tools
  #1  
Old 08-30-2007, 03:12 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Invoking System.Diagnostics.Process Start and changing the parent process

Does anyone know if there's a means by which I can invoke a
Process.Start, then detach the process from the calling process. I
suppose in a nutshell I'm asking if there's a way I can add the new
process to the "explorer" process.

Thanks!

Reply With Quote
  #2  
Old 08-30-2007, 06:11 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Invoking System.Diagnostics.Process Start and changing the parent process

Process.Start spawns a separate process. Every process has its own address
space. Once it's launched, the other process doesn't really have any
connection to the spawned process.


"Dax" <daxmw@comcast.net> wrote in message
news:1188504709.429011.93560@x40g2000prg.googlegro ups.com...
> Does anyone know if there's a means by which I can invoke a
> Process.Start, then detach the process from the calling process. I
> suppose in a nutshell I'm asking if there's a way I can add the new
> process to the "explorer" process.
>
> Thanks!
>



Reply With Quote
  #3  
Old 08-30-2007, 08:11 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Invoking System.Diagnostics.Process Start and changing the parentprocess

pedrito wrote:
> Process.Start spawns a separate process. Every process has its own address
> space. Once it's launched, the other process doesn't really have any
> connection to the spawned process.


Well, yes and no. I don't know the specifics, but Windows does track
which process started which other process. You can see this if you run
SysInternals Process Explorer, which shows the processes in a
hierarchical display, providing that detail.

I would be very surprised if there was a way to change the parent
process after the fact though. It seems to me that this is an integral
part of how the process was started, and so once a process is started
the parent is determined permanently for the lifetime of that process.
I'm not even sure if there's a way in .NET to find out the parent
process of a given process, never mind change it.

I do note that via unmanaged code, you can specify the
PROC_THREAD_ATTRIBUTE_THREAD_PARENT_PROCESS attribute when calling
CreateProcess(). So you can't change the parent, but you can explicitly
declare a parent other than the current parent when the process is first
created.

Again, I don't see anything in .NET that would allow this, but if this
is something that would serve the purpose of the OP, going the unmanaged
route might be worthwhile.

Pete
Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
System.Diagnostics.Process() hangs usenet DOTNET 5 11-13-2007 07:20 AM
System.Diagnostics.Process.Start async callback? usenet CSharp 2 09-04-2007 11:32 AM
what permissions does a windows service need to execute another process? System.Diagnostics.Process process = System.Diagnostics.Process.Start(info); just local administrator? any specific permitions? usenet XML SOAP 1 04-17-2006 04:11 PM
System.Diagnostics.Process.Start fails on windows server 2003 usenet XML SOAP 0 04-12-2006 02:33 PM


All times are GMT -5. The time now is 07:01 AM.