dribler
dribler

Reputation: 41

Bring User Account Control window to front

My product needs to change file association. To allow it to run as non-admin in Vista, I have moved the registry changing code to a separate binary called "assocsetup.exe".

When launched, Vista UAC correctly asks for permission to run it as admin with the "A program needs your permission to continue" message.

However, it doesn't bring it to front immediately. It just flashes its entry on the taskbar and the user must click on it to bring up the UAC window.

Is there any way to automatically make the UAC window visible so the taskbar click is avoided?

Thanks!

Upvotes: 4

Views: 1717

Answers (2)

Anders
Anders

Reputation: 101756

You don't say how you start your helper program, but I assume you are using ShellExecute (You did not specify a language in the tags)

Remember to pass the HWND of your current window to ShellExecute[Ex] (This window needs to be the foreground window when this call is made for the UAC dialog to show as the active window)

Upvotes: 3

Jimmie Lin
Jimmie Lin

Reputation: 2215

Common sense over here, but since UAC triggers the prompt on Window focus, isn't there a way to focus the assocsetup.exe Window so it can dim the desktop and prompt?

Upvotes: 1

Related Questions