开发者

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 bina开发者_StackOverflow中文版ry 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!


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)


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜