How do I prevent "end process tree" from terminating the programs mine has started?

delphi, delphi-xe2

Solution

I think you need to create an intermediate process which in turn spawns `two.exe`. You then need the intermediate process to terminate immediately, at which point the relationship between the original process and `two.exe` is broken.

Problem

I am trying to execute an EXE 'two.exe' from another application 'one.exe' in Delphi XE2 using ShellExecute. ``` ShellExecute(0, 'open', 'two.exe', nil, nil, SW_NORMAL); ``` It works perfectly, but whenever I terminate application 'one.exe' (the parent app) from Task Manager's process tab, using the "end process tree" option, the application 'two.exe' also gets terminated. How can I prevent my ShellExecuted application from getting terminated like this?

Original source

Related problems