shellexecuteex

How to create a process that is not a child of it's creating process?

微笑、不失礼 提交于 2019-11-30 18:11:27
问题 I have two processes, A and B. At some point A creates B. After B is created, if A's process tree is killed, I want B to still be around. I am using CreateProcess() to create B, and I can't seem to find any way to make it create the process without it being a child. Same thing with ShellExecuteEx(), but I am probably missing some flag. Does anyone know what I could use to do this? EDIT: I forgot to mention that both processes need a HANDLE or process ID to the other 回答1: You can try that

Start external app with ShellExecuteEx and wait until it become initialized

蹲街弑〆低调 提交于 2019-11-30 14:05:32
I have an application which needs to run several other applications in chain. I am running them via ShellExecuteEx . The order of running each of the apps is very important cause they are dependant on each other. For example: Start(App1); If App1.IsRunning then Start(App2); If App2.IsRunning then Start(App3); ......................... If App(N-1).IsRunning then Start(App(N)); Everything works fine but there is a one possible problem: ShellExecuteEx starts the application, and return almost immediately. The problem might arise when for example App1 has started properly but has not finished some