Process.Start() and the Process Tree

前端 未结 5 1488
礼貌的吻别
礼貌的吻别 2020-12-11 02:59

How can I use Process.Start(), but have the launched process not in the same process tree as the launching process?

Consider this sample console application:

5条回答
  •  旧时难觅i
    2020-12-11 03:52

    As far as I know, Process.Start() does not support what you are asking for. You would have to use PInvoke to call the Win32 API CreateProcess() function directly so that you can specify the DETACHED_PROCESS flag in its dwCreationFlags parameter.

提交回复
热议问题