Is it possible to send keys to a program without SendMessage
and PostMessage
API?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The official way to fake input does not involve sending or posting Windows messages directly. Instead you are meant to call SendInput
.
When you use SendInput
it is indistinguishable from actually pressing the real keys. When you call SendInput
to fake keyboard input, the system ultimately posts messages to the message queue of the foreground thread that created the window with the keyboard focus.