There is no way to elevate during the lifetime of a process. Whether or not your process runs elevated is decided at process startup time.
I found something similar to what I need in Microsoft Security Essential where it's able to grant Administrator rights without starting a new instance of the application.
No, MSE will be performing the elevated tasks in a separate process.
You don't need to close the existing process and start a new one. What you are expected to do is to use a separate process to perform just the tasks that require elevation. That separate process does not need to show any UI. The elevated process can remain hidden and communicate with the process that displays the UI. The cleanest way to achieve this is to put the elevated tasks inside an out-of-process COM server and to use CoCreateInstanceAsAdmin
.