[highlight="vb"]Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16[/highlight]
Hi, I'm trying to make some hotkeys for a spammer so I can use it in-game, but programming a hotkey with the code asynckeystate and further on will not work. Not on 2010 and also not on 2008, on 2010 (vb version, for those who don't understand) it says my "stack" got unbalanced and therefor is it not a runnable application, and on 2008 it says nothing it just fails. So please help me with this problem. If you need more information about my problem please feel free to ask.
Last edited by Withoutwings; 02-13-2011 at 02:51 PM.
[highlight="vb"]Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16[/highlight]
After Private Class Form1:
Timer with 100 + interval and Enabled:Code:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Hope it helps you..Code:Dim hotkey As Boolean hotkey = GetAsyncKeyState(Keys.Whateveruwant) If hotkey = True Then ' Do whatever u want.. End if
You cant test is by Debugging..Go to the folder and test it..
the problem is in 2010 when i try byval any long it gives unbalnced stack so i once tryed replacing long with integer and it worked
@wow
instead of diming 'nd shid
Code:If GetAsyncKeyState(Keys.A) what ever you want End If
Its works 2 but dont post on solved threads..
None working hotkeys are often due to wrong declarations. The declarations WOW posted does partly have compability issues on x64 bit. Thus, I posted the "proper" declaration that works fine on all systems.
@wow, a lot of unnecessary code in there..
[highlight="vb"]If GetAsyncKeyState(Keys.F1) Then
'bla
End If[/highlight]
T0P-CENT (02-13-2011)
Nice work guys, thread is marked /solved.
No posting unless it's a question that stems from the thread topic,AND the thread is < 7 days old.
Cheers.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)