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 


[Q] VB 2005 Code

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
stimmedcow
How do I cheat?
Reputation: 0

Joined: 21 May 2007
Posts: 5

PostPosted: Mon May 21, 2007 9:43 pm    Post subject: Reply with quote

Here's an outline of what you will want to do:

Create a VB form with the keys you want to be pressed.
When the user selects a key store it in some global variable
Install a system wide keyboard hook
--In the keyboard hook, if F12 is pressed
---Create a timer that will run every so many minutes
-----Use the sendkeys function to press the button
When your program program exits, remove the keyboard hook

I can't paste links so you will need to Google search:
sendkeys vb
timers vb
keyboard hook vb

For the core of your program. sendkeys will send input to the active window, so you will have to additional stuff if you want it on a specific window.
Back to top
View user's profile Send private message
stimmedcow
How do I cheat?
Reputation: 0

Joined: 21 May 2007
Posts: 5

PostPosted: Mon May 21, 2007 10:28 pm    Post subject: Reply with quote

For a specific window, it's simple if you have only one instance of the window on the screen.

For that, all you have to do is use is - FindWindow

Search for "FindWindow vb" and there are some good examples. All you have to do is pass it the title of the window you want to do, or the class of the title if you know it then it will find the window.

If there are more than one window with the same name that gets more tricky and you have to use FindWindowEx, and loop though all windows. There's probably another way to loop though window handles, but FindWindow is easiest.

Once you have the window handle, you can: call SetForegroundWindow to activate the window and then SendKeys will be called for that window.

However, if you do not want to activate the window and just send key messages, that is a lot trickier and I can't help you with that specifically. It depends on how the game processes your key messages. Thats just messing around with SendMessage a bit : /
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