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 


[QUESTION]VB2008 express hotkeys

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

Joined: 19 Aug 2008
Posts: 235
Location: HaHaVille Maryland

PostPosted: Tue Oct 21, 2008 8:04 pm    Post subject: [QUESTION]VB2008 express hotkeys Reply with quote

So in Vb2008 how would you set it so when you press (F12) it enabled a timer... like so?


Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If GetKeyPress(A) Then
            Spammer.Enabled = True
        End If
    End Sub



One of my timers is named Spammer.

_________________
*Rur3k's Haven*

_______________________________________
The wise rapper "Chino" once said, "You can't mapquest your life direction"

My BEST super trainer for Hands of War
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Oct 21, 2008 8:06 pm    Post subject: Reply with quote

Register/UnregisterHotkey
or
GetAsyncKeyState assuming you want a global hotkey.

Otherwise, just override WndProc and respond to the WM_KEYDOWN message.
Back to top
View user's profile Send private message
Rur3k
Expert Cheater
Reputation: 0

Joined: 19 Aug 2008
Posts: 235
Location: HaHaVille Maryland

PostPosted: Tue Oct 21, 2008 8:09 pm    Post subject: Reply with quote

slovach wrote:
Register/UnregisterHotkey
or
GetAsyncKeyState assuming you want a global hotkey.

Otherwise, just override WndProc and respond to the WM_KEYDOWN message.


huh? Arrow could you fix my code...?

_________________
*Rur3k's Haven*

_______________________________________
The wise rapper "Chino" once said, "You can't mapquest your life direction"

My BEST super trainer for Hands of War
Back to top
View user's profile Send private message MSN Messenger
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Tue Oct 21, 2008 9:06 pm    Post subject: Reply with quote

Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If GetASyncKeyState(VK_A) Then
            Spammer.Enabled = True
        End If
    End Sub

_________________
Back to top
View user's profile Send private message
Rur3k
Expert Cheater
Reputation: 0

Joined: 19 Aug 2008
Posts: 235
Location: HaHaVille Maryland

PostPosted: Tue Oct 21, 2008 9:44 pm    Post subject: Reply with quote

Snootae wrote:
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If GetASyncKeyState(VK_A) Then
            Spammer.Enabled = True
        End If
    End Sub

thanks! but it says GetASyncKeyState(VK_A) is undeclarable. And get build fail.

_________________
*Rur3k's Haven*

_______________________________________
The wise rapper "Chino" once said, "You can't mapquest your life direction"

My BEST super trainer for Hands of War
Back to top
View user's profile Send private message MSN Messenger
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Tue Oct 21, 2008 9:47 pm    Post subject: Reply with quote

Code:
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

_________________
Back to top
View user's profile Send private message
Rur3k
Expert Cheater
Reputation: 0

Joined: 19 Aug 2008
Posts: 235
Location: HaHaVille Maryland

PostPosted: Tue Oct 21, 2008 10:01 pm    Post subject: Reply with quote

Snootae wrote:
Code:
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer


I think it is this then...
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If GetAsyncKeyState(vKey:=1) Then
            Spammer.Enabled = True
        End If
    End Sub


If I dont do(vKey:=1) it will auto fail my build success. ;(

_________________
*Rur3k's Haven*

_______________________________________
The wise rapper "Chino" once said, "You can't mapquest your life direction"

My BEST super trainer for Hands of War
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Oct 21, 2008 10:14 pm    Post subject: Reply with quote

Isn't := the pascal assignment operator?

You'll need to use:
Code:
Imports System.Runtime.InteropServices
to make use of the Win32 API.

Code:
<DllImport("user32.dll")> _
    Public Shared Function GetAsyncKeyState(ByVal vKey As Int32) As Short
    End Function


Pinvoke signature. NOW you can call it.

You can use the Keys class to get the virtual keys, or define them yourself.

Code:
if GetAsyncKeyState(Keys.A)
Is already the equivalent of asking if it's true.

Look at MSDN and pinvoke.net. Take a good look at the name of it though. Guess what you're going to have to do?

Hint: call it over, and over to do your checks.
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