How will ProcessStartInfo.UseShellExecute affect my running process?
Do i need special permissions from UAC to UseShellExecute?
Will it run on diffrent user?
Will it give me new permissions?
Windows has two distinct api functions to get a process started. The low-level one is CreateProcess(), it directly maps to a native api function. And there's ShellExecuteEx(), a function that's implemented by the shell (Explorer). It has a much higher level of abstraction.
They are very different capabilities and that's something you see back in the documentation for ProcessStartInfo. CreateProcess() can only start executable files but it has good support to control a console mode program, including the ability to redirect I/O and control the appearance of the console window. ShellExecuteEx() takes advantage of the capabilities added by the shell, file associations being the big one, so you can start the executable that's registered for a specific filename extension.
Both api functions have options to affect the way the process execute. You'll see a close correlation between the properties of the ProcessStartInfo class and the Process Creation Flags supported by CreateProcess and the fields in the SHELLEXECUTEINFO structure that ShellExecuteEx() uses. But these features don't overlap so that's why you need to tinker with UseShellExecute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With