发送没有SendMessage和PostMessage的密钥 [英] Send keys without SendMessage and PostMessage

查看:87
本文介绍了发送没有SendMessage和PostMessage的密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在没有 SendMessage PostMessage API的情况下将密钥发送到程序?

Is it possible to send keys to a program without SendMessage and PostMessage API?

推荐答案

伪造输入的官方方法不涉及直接发送或发布Windows消息。相反,您应致电 SendInput

The official way to fake input does not involve sending or posting Windows messages directly. Instead you are meant to call SendInput.

当您使用 SendInput 时,与实际按下真实按键是无法区分的。当您调用 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.

这篇关于发送没有SendMessage和PostMessage的密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆