I'm running an application using an Authotkey script, which requires UAC. I've read some开发者_如何学C post about it, but I can't get a clear answer explaining why it seems not possible to accept the prompt using Autohotkey.
My code is something like this:
Run,"%A_ProgramFiles%\someprogram.exe",,Max
Send !Y ; Send Alt-Y
I understand the process dispatched by the first line is halt by UAC, but the autohotkey process should continue working, right? I tried inserting a pause before, and also with mouseclick, unsuccessful.
Thanks,
No, the autohotkey process should not run in the secure desktop where the UAC prompt is displayed. See http://blogs.msdn.com/b/uac/archive/2006/05/03/589561.aspx and http://technet.microsoft.com/en-us/magazine/2009.07.uac.aspx for details.
I use a TIMER to check for the presence (WINEXIST) of alert windows every second or so.
IF WINEXIST alert window Send !Y
Otherwise, your !Y is typing into the ether, and not into the UAC alert window
精彩评论