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.
I want to be able to do these things even though when the window
is minimized for example. Could anyone tell me how to do it, or write
(link) to a tutorial so I can learn how to do it?
I think I have to hook to Final Fantasy XIV or something? but I have
no experience with hooks and that kind of stuff
Yes I tried Send/Post message but those do nothing for me.
Nothing happens at all.
My current code:
Quote:
// bring the window to the front
HWND GameWindow = FindWindow(0, L"Untitled- Notepad");
SetForegroundWindow(GameWindow);
// execute the loop
for( int i = 0; i < amount; i++ ){
// not the last loop so add a pause at the end
if( i < (amount-1))
{
PostMessage(GameWindow, WM_KEYDOWN, 'G', 0);
PostMessage(GameWindow, WM_KEYUP, 'G', 0);
Sleep(2000);
}
// last loop so dont add a pause at the end
else
{
PostMessage(GameWindow, WM_KEYDOWN, 'G', 0);
PostMessage(GameWindow, WM_KEYUP, 'G', 0);
}
}
the game most likely will ignore all keystrokes send to it while minimized, or doesnt even use the windows message pump to get keystrokes.
if it doesnt use the message pump for keystrokes you have to hook the method its using to check for keystates (will most likely be DirectInput) and hook it.
Tut: (German though, but full code sample for a directinput hook.)
if it doesnt react to keystrokes sent to it while minimized you have to reverse and find out how it checks whether its minimized/maximized and accepts keystrokes.
both are a lot of work - have fun.
edit:
btw. instead of saying "thanks" in your posts to moepmoep you can press that little "*THANKS" button right down at the post to increase our Thanks Counter and to maximize our E-*****-Size.
Thanks in advance
yeah thats what I was thinking about lol. Hooking, but I have totally no knowledge on how to do that or how that works haha.
I know that someone made a bot called OttoBot which does that though, he sends keys and everything to the game minimized or not, it does not matter lol. Thats what I wanted to learn, how to send keys even if something is minimized haha.
Is there any ENGLISH tutorial on how to do hooking and so on? cause my german is not good enough to understand the link you gave me its awesome but, my german is not good enough lol =)
Simulating Keystrokes 11/18/2011 - General Gaming Releases - 6 Replies Hi folks,
usually I am not releasing my stuff. But here is a small hint for "do it yourself" people, how to simulate keystrokes for Warhammer Online.
The usual way to do that via Postmessage or kbdevent does NOT work here, because Warhammer is a DirectInput game.
It cost me some hours to figure out a proper but easy way how to do it:
INPUT input;
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
How can i send keystrokes to an application in background 04/09/2008 - Archlord - 3 Replies i need something like a macro that can send keystrokes to an application in background and loop the sending in delay of 2 minutes or something... Any1 have an idea how can i do this or where can i download such program?