[英]How to detect if keystroke was emulated by keybd_event or SendInput?
You could check if the LLKHF_INJECTED
flag is set in a low-level hook.您可以检查是否在低级挂钩中设置了LLKHF_INJECTED
标志。 I don't think you can tell just by looking at the LPARAM.我认为您不能仅通过查看 LPARAM 来判断。
Starting in Windows 8, you can use the GetCurrentInputMessageSource()
function in your message handler.从 Windows 8 开始,您可以在消息处理程序中使用GetCurrentInputMessageSource()
函数。 You can check if the reported originId
is IMO_HARDWARE
, IMO_INJECTED
, or IMO_SYSTEM
.您可以检查报告的originId
是IMO_HARDWARE
、 IMO_INJECTED
还是IMO_SYSTEM
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.