发送键盘宏命令的Windows游戏 [英] Sending Keyboard Macro Commands to Game Windows
问题描述
我想为游戏做一个宏程序。但是,有一个与发送键只有游戏应用程序(游戏窗口)的一个问题。我使用 keybd_event
API发送键游戏窗口。但我只想发送键的游戏窗口,而不是资源管理器或我的任何宏程序运行时打开的窗口。当我改变窗口的仍然是发送键。我试图用 Interaction.App
与视觉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,钥匙, {得给关键的lParam} );
PostMessage(hWnd, WM_KEYDOWN, key, {have to give lParam of the key});
否则不work.And我们可以与微软的间谍工具++控制ChildWindow类。
otherwise it does not work.And we can control of ChildWindow Class with Spy++ tool of Microsoft.
感谢大家的帮助。
这篇关于发送键盘宏命令的Windows游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!