views:

409

answers:

2

I'ved developed a c# application that captures screens using bitblt and sends keyboard and mouse events using calls to keybd_event and mouse_event.

According to Microsoft I needed to modify the app.manifest with: requestedExecutionLevel level="highestAvailable" uiAccess="true"

Sign the application and place it in a trusted location (program files).

I have done all of these to get the application to run under elevated priviledges under Vista but when UAC dialogs appear it does not capture those screens and the keyboard and mouse events do not reach the UAC dialog.

I am guess that UAC runs in a different desktop?? if so, how would i capture that? and how can i detect when the desktop switches to a UAC dialog in c#? or have i just missed a step?

+1  A: 

You cannot. The UAC desktop is secure because it doesn't allow anyone to access it. To detect the desktop switch event, I would try to use SENS or WTSRegisterSessionNotification. But it doesn't look very promising.

jachymko
+2  A: 

UAC runs on the secure desktop, only trusted processes running on the system account are allowed to run in that context.

This is to prevent exactly what you are trying to achieve - processes spoofing or capturing user input.

Andrew Grant