winapi - CreateProcess to run as administrator -
In my Win32 application, I have the ability to run child processing with redirect input and output that I create and manage on anonymous pipes - all this works with the CreateProcess () function. However, if Win7 (and potentially Vista) is required to run that process as an administrator, then it fails. So what I'm looking for is a way to equalize the "run as administrator" in Explorer, which will bring the standard UAC prompt and then make processes with higher permissions. I have seen those articles that talk about ShellExecute to use the "Run" option, but then as I think I do not have the control, I want to redirect SDD input and output to my pipes is required. Any suggestions?
If you put a manifest on the child app, and if you use ShellExecute to launch , It will use the manifest and will have a UAC prompt. (I like the "Rasa" approach in most cases.) This allows you to launch the app as you like, without worrying about the UAC, and have to raise it from the manifest.
However, if you have been referred to a "managed" part, then there may be some problems in it, which includes a high privilege app that communicates with an elevated one. The UAC refused.