View previous topic :: View next topic |
Author |
Message |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Sun Jul 25, 2010 4:56 am Post subject: SendInput API |
|
|
mmm i was searching about how can i move a Char into and i found that can be made my SendInput :] which works awsome, just for 1 issue.
with this code:
Code: |
bool MoveToCoord(int coord){
Sleep(500);
HWND BlaHwnd = FindProcessWindow(GetCurrentProcessId(),"blablabla");
SetForegroundWindow(BlaHwnd);
if(getX()==coord)
return true;
else if(getX()<coord)
//100 200-220
while(getX()<coord){
Sleep(10);
if(GetForegroundWindow()==BlaHwnd)
SendKeybyTimes(VK_RIGHT,15);
Sleep(10);
if(getX()>=coord)
return true;
}
else if(getX()>coord)
//200 100-120
while(getX()>coord){
Sleep(10);
if(GetForegroundWindow()==BlaHwnd)
SendKeybyTimes(VK_LEFT,15);
Sleep(10);
if(getX()<=coord)
return true;
}
return false;
}
|
i can make to my Char go to where i want, but... it only works if Bla Windows is focused...
is there a way to do it without it being focused? :[
i believe this is how blabot works.
:]
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Jul 25, 2010 5:04 am Post subject: |
|
|
i'd assume you would need the window to be active since it's the same effect as you physically pressing it.
|
|
Back to top |
|
 |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Sun Jul 25, 2010 5:12 am Post subject: |
|
|
slovach wrote: | i'd assume you would need the window to be active since it's the same effect as you physically pressing it. |
yes ( i think we're talking about same thing )
i need to that window be active to SendInput Works.
is there a way :'(
i mean let that trainer sending key to my game window and i am let's say chating on msn
|
|
Back to top |
|
 |
the_undead Expert Cheater
Reputation: 1
Joined: 12 Nov 2006 Posts: 235 Location: Johannesburg, South Africa
|
|
Back to top |
|
 |
XaLeX Expert Cheater
Reputation: 0
Joined: 19 Aug 2008 Posts: 226
|
Posted: Mon Aug 30, 2010 4:00 pm Post subject: |
|
|
the_undead wrote: | http://somebastardstolemyname.wordpress.com/2007/03/27/5/ | He's not asking how to use SendInput, he's asking for a workaround for the focus issue.
Just a thought, would posting WM_KEYDOWN and WM_KEYUP messages work?
|
|
Back to top |
|
 |
|