Question: 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?

Answer: 
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.
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](http://msdn.microsoft.com/en-us/library/aa383841(VS.85).aspx) or [WTSRegisterSessionNotification](http://msdn.microsoft.com/en-us/library/aa383841(VS.85).aspx). But it doesn't look very promising.