Not sure what 'some software' might be, but sure, UAC stops you from poking messages into the windows of elevated programs.
(不知道可能是什么“某些软件”,但可以肯定的是,UAC阻止您将消息发送到高级程序的窗口中。)
It is called UIPI, User Interface Privilege Isolation. (它被称为UIPI,用户界面特权隔离。)
In general, faking input with PostMessage doesn't work well at all.
(通常,用PostMessage伪造输入根本无法正常工作。)
It is especially a problem for keyboard input but mouse input has trouble too. (对于键盘输入来说尤其是一个问题,但是鼠标输入也有麻烦。)
There is no good way to alter the keyboard state for another process. (没有好的方法来更改另一个进程的键盘状态。)
That matters when the program checks the state of the Shift, Ctrl and Alt keys when it processes the input message. (当程序在处理输入消息时检查Shift,Ctrl和Alt键的状态时,这一点很重要。)
Many do. (很多。)
The only real solution is to emulate input with SendInput().
(唯一真正的解决方案是使用SendInput()模拟输入。)
Now you got a focus problem to solve. (现在您有一个重点问题要解决。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…