How to create a process that is not a child of its creation?

I have two processes: A and B. At some point A creates B. After creating B, if the process tree is destroyed, I want B to still be around.

I use CreateProcess () to create B, and I cannot find a way to create the process without being a child. Same thing with ShellExecuteEx (), but I probably miss some kind of flag.

Does anyone know what I can use for this?

EDIT: I forgot to mention that both processes require a HANDLE identifier or a process ID for another

+3
source share
2 answers

. C, B, C (). B ( C, ), A. , " ", B, , .

, Process Explorer (. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx), Total Commander. Total Commander cmd.exe. cmd.exe notepad.exe. "exit" cmd.exe. cmd.exe , notepad.exe Total Commander (totalcmd.exe). Process Explorer "Kill Process Tree" Total Commander (totalcmd.exe) , notepad.exe .

+1

paramaeter dwcreationflags DETACHED_PROCESS API .

+3

Source: https://habr.com/ru/post/1752154/


All Articles