 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
kot1990 Expert Cheater
Reputation: 1
Joined: 06 Sep 2009 Posts: 131 Location: Greece
|
Posted: Mon Apr 19, 2010 7:11 am Post subject: help sending keys... |
|
|
I want to send keys to a specified window in C++. I tried sendinput, it works, but it doesn't send the key to a specified window. I also tried PostMessage() as follows to send the key '4'
Code: |
PostMessage(Win, WM_KEYDOWN, 0, 0x50001);
PostMessage(Win, WM_KEYUP, 0, 0x50001);
|
I put it in a loop but it sends the key only if I press some key on the keyboard, it won't work automatically
EDIT: I also tried with wParam
Code: |
PostMessage(Win, WM_KEYDOWN, 0x34, 0);
PostMessage(Win, WM_KEYUP, 0x34, 0);
|
and also tried to put them both wParam and lParam but nothing worked.
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Mon Apr 19, 2010 8:40 am Post subject: |
|
|
Is the window you are trying to send to a game window or your own ?
|
|
Back to top |
|
 |
kot1990 Expert Cheater
Reputation: 1
Joined: 06 Sep 2009 Posts: 131 Location: Greece
|
Posted: Mon Apr 19, 2010 8:43 am Post subject: |
|
|
It's a game window, but my app is injected in it, so it's the same process. I also tried keybd_event() but it sends keystrokes to everything is active, not only the game.
EDIT: I log in the game, inject my dll, and then it should press repeatedly the key '4'. It does nothing,, but if I press a random key on the keyboard,, then the key '4' is pressed (the game window has to be active). It happens only when I press a key on the keyboard. The same is not happening when I click somewhere.
EDIT2: I'm pretty sure that the game has a check before processing the WM_KEYDOWN & WM_KEYUP messages. I think its something like
Code: |
switch(msg)
{
case: WM_KEYDOWN
if(whatIamLookingFor)
{
process message;
}
case: WM_KEYUP
if(whatIamLookingFor)
{
process message;
}
}
|
I want to create a keyPresser than to send packets for skills,, because the skills are to many and its hard to get only the skills that the player has, because this data is transmitted by the server when the char logs in, and the packet has so many data in,, I can't analyze the whole structure of the packet. It has dozens of variables and its very hard.
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|