开发者

How to send keypresses to a DirectX application?

I need to write a program in any programming language (preferably Delphi 7 / Delphi 10 / C#) that emulates pressing 1 every 10 seconds to a given process in Windows XP or Windows 7. Sending Windows messages, which worked for all the other applications I have tried, didn't work for this particular one and I am suspecting it is because it is using DirectX. Can this be done without overwriting DX*.DLL files? How?

Thank y开发者_StackOverflow社区ou,

Tom

EDIT: I've just tried using SendInput (in Delphi 7 on Windows XP with code from http://www.swissdelphicenter.ch/torry/showcode.php?id=220) and that doesn't work, either


If the application don't process WM_CHAR/etc Windows Messages (XInput/DirectInput) your best bet is to make a dll to inject into the app overriding some of the functions cause those use directly the system resources to access the keyboard/mouse/gamepad. (really bad idea to use DirectInput/XInput for keyboard anyway :|)


The application is probably using DirectInput or XInput. There is little you can do in this case because DirectInput works directly with the keyboard driver.


Finally, I've used IO.DLL, which unfortunately doesn't work on 64-bit, but I'm still happy that about 90% of my target uses 32-bit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜