如何使用C ++和Windows API将击键/消息发送到Windows 7? [英] How to send keystrokes/messages to Windows 7 with C++ and Windows API?

查看:44
本文介绍了如何使用C ++和Windows API将击键/消息发送到Windows 7?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,程序是否可以向Windows 7(正在运行的操作系统)发送击键或消息,以模拟用户实际按下其键盘上的Windows键的效果;使用Windows API在C ++中实现?

Is it possible for a program to send keystrokes or messages to Windows 7 (the operating system it's running on) to simulate the effect of a user physically pressing the Windows key on their keyboard, for example; in C++, using the Windows API?

推荐答案

The SendInput function has been available for ages, and should do just what you need.

这篇关于如何使用C ++和Windows API将击键/消息发送到Windows 7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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