SendInput fails on UAC prompt

  • Thread starter Thread starter Damian
  • Start date Start date
D

Damian

I am upgrading a c# Remote Control application (like VNC) to handle UAC
prompts. I've found that SendInput is failing. Here is what i have done:
1. A windows service launches the app on the user desktop running with
SYSTEM account priviledges
2. The app then launches a second app using ShellExecute (using
System.Diagnostics.Process.Start)
3. The second app has uiAccess=true in the manifest file and is now also
running under the SYSTEM account. It is authenticode signed and is located in
c:\program files
4. During remote control it is able to screen capture the UAC dialog

The problem is that when calling SendInput to move the mouse or send
keyboard commands it fails silently on the UAC secure desktop (but works fine
on the regular desktop).

Here is the method for SendInput:
static extern UInt32 SendInput(UInt32 numberOfInputs, INPUT[] inputs, Int32
sizeOfInputStructure);

Is there some other reason that Vista/Windows 7 is blocking the SendInput
command? If i can screen capture then why not send keyboard/mouse commands?

Thanks,
Damian
 
I am upgrading a c# Remote Control application (like VNC) to handle UAC
prompts. I've found that SendInput is failing. Here is what i have done:
1. A windows service launches the app on the user desktop running with
SYSTEM account priviledges
2. The app then launches a second app using ShellExecute (using
System.Diagnostics.Process.Start)
3. The second app has uiAccess=true in the manifest file and is now also
running under the SYSTEM account. It is authenticode signed and is located in
c:\program files
4. During remote control it is able to screen capture the UAC dialog

The problem is that when calling SendInput to move the mouse or send
keyboard commands it fails silently on the UAC secure desktop (but works fine
on the regular desktop).

Here is the method for SendInput:
static extern UInt32 SendInput(UInt32 numberOfInputs, INPUT[] inputs, Int32
sizeOfInputStructure);

Is there some other reason that Vista/Windows 7 is blocking the SendInput
command? If i can screen capture then why not send keyboard/mouse commands?

Thanks,
Damian

Consider posting in a developers' newsgroup or forum...Although a few
people here (not me) have some knowledge in that area.
 
hi :-)

i also do have the same problem with sendinput and the UAC.
is there already a solution? (can't find anything elsewhere..)

would be _really, really_ helpful if someone answers with a little hint...

thanks,
Dan.
 
hi :-)

i also do have the same problem with sendinput and the UAC.
is there already a solution? (can't find anything elsewhere..)

would be _really, really_ helpful if someone answers with a little hint...

thanks,
Dan.

You could begin by following the advice I gave in the post you replied to -
and start your own new thread, rather than piggy-backing off an ancient
thread. That way you might get more attention.
 
Back
Top