I need to start a subprocess with elevated privileges from C++ code. I'm not familiar with Windows APIs at all, and from cursory googling I found out that
a) to start an elevated process I need to use ShellExecute
with the runas
verb.
b) to communicate with subprocess via stdin/stdout I have to use CreateProcess
But I haven't found a way to do both at the same time.
Additionally, I need to
either get a callback when the process finishes, or poll it to see whether it's still running
check its return code
As I said, I'm completely unfamiliar with Windows API, so could someone point me to the right functions?