Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


SendInput API

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
gunminiho
Expert Cheater
Reputation: 0

Joined: 15 Dec 2008
Posts: 144
Location: peru

PostPosted: Sun Jul 25, 2010 4:56 am    Post subject: SendInput API Reply with quote

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
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Jul 25, 2010 5:04 am    Post subject: Reply with quote

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
View user's profile Send private message
gunminiho
Expert Cheater
Reputation: 0

Joined: 15 Dec 2008
Posts: 144
Location: peru

PostPosted: Sun Jul 25, 2010 5:12 am    Post subject: Reply with quote

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
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Mon Aug 30, 2010 1:24 pm    Post subject: Reply with quote

http://somebastardstolemyname.wordpress.com/2007/03/27/5/
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
XaLeX
Expert Cheater
Reputation: 0

Joined: 19 Aug 2008
Posts: 226

PostPosted: Mon Aug 30, 2010 4:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites