I am using IShellDispatch2.ShellExecute to run a process under standard user from my elevated process, as described in Raymond Chen's article. Unlike ShellExecuteEx, this method does not return any information about the process.
I need to know when the launched process finishes, and I may need its exit code. Is there a way to obtain a handle of this process (any other way than taking snapshots)?
You can't because the shell does not expose a ShellExecuteEx method, and even if it did, the returned process handle would not be valid in your process.
The least hacky solution I can think of is to create a little helper application that acts as a middleman between the shell and the real application you want to start. This middleman application can call
ShellExecuteExand send a message back to your real application when the child process has exited.