because it is using directinput instead of the windows message queue i guess. so the window itself doesnt care about anything it receives unless it is a quitmessage.
get the handle of the directinput device and send your messages there. you won't find that one with FindWindow, you gotta query its GUID from the process and the try to copy the handle with full access, a rather complex process.
if its not necessary that the window is in the background you can try SendInput with DInput keycodes.
otherwise you should do what tnd0 said, or hook dinput like this:
if you want to make a bot which works in the background, you should reverse the game and call the functions which get called when you press a key on your own.
Okay, I included this file and now it says:
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
How to send keystrokes to a game 01/14/2012 - C/C++ - 13 Replies Dear reader,
I am recently starting to learn C++.
I have the following problem:
I build this GUI program which should repeat my shouts
by a simple method.
Send a "space", then "up key", then "enter key" command.
Only this is, that it will not respons if the window is not focussed.
Game Starting *Don't Send* 08/25/2011 - Dekaron - 5 Replies When I start dekaron, it says Game Starting *Don't Send*, i tried reinstalling so many time, what should I do?
can someone send me game.exe *German* 11/30/2010 - Shaiya Hacks, Bots, Cheats & Exploits - 1 Replies hi can some1 pls help me i accidentally deleted the game.exe of German Shaiya pls send 1 the original... [email protected] tnx alot
[Help] send messages 08/12/2009 - Kal Online - 0 Replies hi...
i have points on the kal window that i need to click on
now...i tried to simply send them at the beggining..
but than i realized that its stupid since all the pixel bots are detected
so...i need help
after that i tried to "sniff" (Spy++) the messages and i got that 3 messages are sent when u move the mouse:
cool...i sent them all as a set every 100milisec so that the game "think" i am moving the mouse over the game window
and..now for the clicking part:
i found those-