views:

107

answers:

3

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

A: 

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.

George Edison
+1  A: 

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 :|)

feal87
A: 

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.

Tom
Is there any way you could use this from C#?
luvieere
@luvieere: Try this: http://www.adp-gmbh.ch/csharp/call_dll.html and if everything fails, ask your question on StackOverflow :)
Tom