API & Sendkeys won't work on most current Direct X Games, you can try jasons string sender, you need to realize that Windows API is NOT = DirectInput.
DirectInput goes WAY below the Windows Input interface and can not be accessed by the winapi, If you want to create a autofire or a spammer or w/e you need to find out what type of level the game recieves its input on. If you can figure that out then we can do something about it.
Sendmessage & Postmessage may be a good idea however.