AliR (VC++ MVP) said:
Here are a couple of lines from MSDN
Microsoft Windows Vista. This function fails when it is blocked by User
Interface Privilege Isolation (UIPI). Note that neither GetLastError nor
the return value will indicate the failure was caused by UIPI blocking.
Microsoft Windows Vista. This function is subject to UIPI. Applications
are permitted to inject input only into applications that are at an equal
or lesser integrity level.
I think if you disable UAC on the test machine then it should work fine.
(Otherwise I haven't found a workaround solution, it wouldn't make any
sense to have a workaround since this is a security restriction)
Yes, and another less invasive workaround is to simply run the OP's app (the
one that calls SendInput) As Administrator. To force this to happen, embed
a manifest in it that has:
<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="AppName"
type="win32" />
<description>App Description</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"
uiAccess="true"/>
<!-- level=”asInvoker” or level=”requireAdministrator” or level=”highestAvailable”-->
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
For more info, see
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1180962&SiteID=1
-- David