如何将鼠标和键盘事件发送到另一个进程? [英] How do I send mouse and keyboard events to another process?

查看:166
本文介绍了如何将鼠标和键盘事件发送到另一个进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们假设我们有两个窗口进程,



进程A是发件人,进程B是接收方。



进程B正在运行一个经典的Win32 API事件循环



如何从进程A生成并发送鼠标和键盘事件到B? p>

解决方案

基本上通过 SendMessage PostMessage 。如果要模拟整个操作系统的输入事件,则 SendInput 可能很有趣。


Let's assume that we've got 2 windows processes ,

Process A is the sender, and Process B is the receiver.

Process B is running a classic Win32 API events loop

How do I generate and send mouse and keyboard events from process A to B ?

解决方案

Basically via SendMessage or PostMessage. If you want to simulate input events for the whole operating system, then SendInput might be interesting.

这篇关于如何将鼠标和键盘事件发送到另一个进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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