Search code examples
c#delphidirectxwindows-messages

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 you,
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


Solution

  • 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.