Question

I need to perform certain operations on a process started with ShellExecuteEx - like waiting for it, duplicating handles, querying and setting information etc. Now I am wondering if I can do all these things on the hProcess member which is returned in the SHELLEXECUTEINFO structure I pass to ShellExecuteEx. Does anybody know this?

Does the process that called ShellExecuteEx have rights like PROCESS_DUP_HANDLE, SYNCHRONIZE, PROCESS_SET_INFORMATION, PROCESS_QUERY_INFORMATION (and so on) by default, when using the returned hProcess?

Was it helpful?

Solution

I would guess that it is the same as what you get from CreateProcess, though even that documentation doesn't say (I would venture PROCESS_ALL_ACCESS). In any event, you could always do GetProcessId() and OpenProcess() to open it with whatever access you need.

OTHER TIPS

Yes. The online time you need to worry about access rights is if you do any task that trigger the uac, then you need to set the requestedExecutionLevel= 'highestAvailable'

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top