You cannot elevate access rights to a process while a process is running. a common way is to create a new process with elevated permissions when necessary. This process then does the work requiring higher privileges, and then exits, freeing control from the main process. You should make this simple enough by setting the new parent process window in the main process window.
Another alternative is to restart the main program with the required permissions.
There is an article article about UAC in Vista with C ++ examples that looks pretty detailed.
source
share