views:

162

answers:

1

I am using the Java Robot class to take screenshots, my problem is that in W7 when the UAC dialog is shown (i right click on any application and select run as Admin) it will not appear in the screen shot or the whole screen is just black. Running my application with admin rights or as a service does not solve the problem. Please, does any one know what to do so that i will be able to capture the screen even when the UAC is showing?

Thanks

A: 

For security, normal programs cannot interact with the UAC dialog.

You can manually disable that security feature named "Secure Desktop" and instead have the dialog displayed on the normal desktop (so other programs can see it), but this is not recommended. The following explanation is for Vista, but Win7 should work similar: http://www.vistax64.com/tutorials/117448-user-account-control-uac-blacking-out-screen.html

Christian Semrau
Thank a lot for your answer, but disabling UAC is not an option for me to do it.What i need is the solution because i understand the problem. I know that it is possible, because VNC for example can capture the screen, even when UAC is enabled, but only when it is run as a service, they met the same problem but they solved it. what i need is the exact solution(or the method used by VNC)thanks again.
My answer is not about disabling UAC, but disabling the "Secure Desktop" feature used to display the dialog. I am sorry but I don't know how VNC displays the UAC dialog remotely.
Christian Semrau
ah ok, thanks, i understand it now, i will try to use it until i find a convenient solution.