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 


How do I Add Hot Keys To VB 2005/2008/2010

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
InternetIsSeriousBusiness
Grandmaster Cheater Supreme
Reputation: 8

Joined: 12 Jul 2010
Posts: 1268

PostPosted: Sun Aug 15, 2010 6:50 pm    Post subject: How do I Add Hot Keys To VB 2005/2008/2010 Reply with quote

I am currently making an awesome trainer but i ran into this issue i couldnt figure out how to add hot-keys
I have vb 2010
+rep if gaven the right code
PLZ HELP!!!!!!!!!!!!!!!!!!

_________________
FLAME FLAME FLAME!!!@@@
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 Aug 15, 2010 7:16 pm    Post subject: Reply with quote

GetAsyncKeyState()
http://www.pinvoke.net/default.aspx/user32.GetAsyncKeyState

or RegisterHotKey()
http://www.pinvoke.net/default.aspx/user32/RegisterHotKey.html


GetAsyncKeyState() is probably the safer bet. Just set up a loop to poll for your key presses.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Mon Aug 16, 2010 4:24 am    Post subject: Reply with quote

You can use this api:


- GetAsyncKeyState


Or you can install a keyboard hook, but that seems too advanced for you, here is an example for you (I haven't coded in VB.NET in a while, so there may be some small syntax errors):

Code:

Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal Key As Long) As Integer


Add that to the top of your code, then in your button or whatever, add this code (If the user presses the control key, alias is CTRL):

Code:

If GetAsyncKeyState(17) Then
  MsgBox("Hi")
End If


This should work each time you hit your button or whatever, or you can put it in a timer.
Back to top
View user's profile Send private message MSN Messenger
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