向游戏窗口发送键盘宏命令 [英] Sending Keyboard Macro Commands to Game Windows

查看:64
本文介绍了向游戏窗口发送键盘宏命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个游戏的宏程序.但是仅将密钥发送到游戏应用程序(游戏窗口)存在问题.我正在使用 keybd_event API 将密钥发送到游戏窗口.但是我只想将键发送到游戏窗口,而不是在我的宏程序运行时发送到资源管理器或任何打开的窗口.当我更改 Windows 时,它仍在发送密钥.我尝试将 Interaction.AppVisual Basic.dll 引用一起使用.但是 Interaction.App 只聚焦游戏窗口.

I wanna do a macro program for a game. But there is a problem with sending keys to only game application (game window). I am using keybd_event API for sending keys to game window. But I only want to send keys to the game window, not to explorer or any opened window while my macro program is running. When I changed windows its still sending keys. I tried to use Interaction.App with Visual Basic.dll reference. But Interaction.App only Focus the game window.

我找不到任何关于我的问题的信息.谁能帮我?谢谢

I couldn't find anything about my problem. Can anyone help me? Thanx

推荐答案

我解决了我的问题.在这个领域;

i fixed my problem. in this field ;

PostMessage(hWnd, WM_KEYDOWN, key, {必须给出键的 lParam});

PostMessage(hWnd, WM_KEYDOWN, key, {have to give lParam of the key});

否则它不起作用.我们可以使用Microsoft的Spy++工具控制ChildWindow Class.

otherwise it does not work.And we can control of ChildWindow Class with Spy++ tool of Microsoft.

感谢大家的帮助.

这篇关于向游戏窗口发送键盘宏命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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