R – Screen capture and event with Vista UAC

captureuacwindows-vista

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?

Best Solution

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.