Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Help]64Bit Hotkeys[Solved]

Question[Help]64Bit Hotkeys[Solved]

Posts 1–15 of 28 · Page 1 of 2
xsaban13x
xsaban13x
[Help]64Bit Hotkeys[Solved]
NextGen1, i was just trying to fix the hotkeys on my spammer over teamviewer with hejsan but he couldn't get them to work.. He said it was this code...

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer

He said the problem is I am 64 bit...
He also said you might now how to fix it..
#1 · 16y ago
NextGen1
NextGen1
Returning short (16 bits, not 32)

[php]
<DllImport("user32.dll", CharSet:=CharSet.Auto, setLastError:=True)> _
Public Function GetAsyncKeyState(ByVal vKey As Integer) As Short
End Function

Public Function GetAsyncKeyState(ByVal vKey As Int32) As Int16
[/php]

please let us know if it works, many others may have this problem as well

#2 · 16y ago
xsaban13x
xsaban13x
Quote Originally Posted by NextGen1 View Post
Returning short (16 bits, not 32)

[php]
<DllImport("user32.dll", CharSet:=CharSet.Auto, setLastError:=True)> _
Public Function GetAsyncKeyState(ByVal vKey As Integer) As Short
End Function

Public Function GetAsyncKeyState(ByVal vKey As Int32) As Int16
[/php]

please let us know if it works, many others may have this problem as well

Yes, it did work.. Thank you very much! I will give you and Hejsan credits..
#3 · 16y ago
Blubb1337
Blubb1337
Will this work for x32/x64 bit or for x64 bit only?
#4 · 16y ago
NextGen1
NextGen1
This will work for X86,X64.

But would it be necessary or productive, don't know

/marked solved

#5 · 16y ago
UB
ubanooba
I have the same problem, I use all the correct codes and stuff but when I press a hotkey nothing happens. There's no errors or problems with bugs. I tried imputting your code NextGen1 but it said Type "DllImport' is not defined. Any help would be appreciated.
#6 · 16y ago
NextGen1
NextGen1
Above

Code:
Public Class Form1
add

[php]
Imports System.Runtime.InteropServices
[/php]
#7 · 16y ago
UB
ubanooba
Sorry I'm relatively new to VB, do i place <DllImport> below Public Class Form1?
#8 · 16y ago
Blubb1337
Blubb1337
Namespaces are placed above public class form1.
#9 · 16y ago
NextGen1
NextGen1
Yes , it would be


Sample code for demonstration purposes
[php]
'namespace
Imports System.Runtime.InteropServices

Public Class Form1
<DllImport("user32.dll", CharSet:=CharSet.Auto, setLastError:=True)> _
Public Function GetAsyncKeyState(ByVal vKey As Integer) As Short
End Function

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' random
End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'random
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'random
End Sub

Public Sub HotKey(ByVal hotkey As Boolean)
'random
End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
'random
End Sub

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles WebBrowser1.DocumentCompleted
'random
End Sub

End Class

[/php]

The concept is similar to tags in web design

First I like to create notes so 'Comments after " ' "
First Your Imports
Then we will call the next your Form name Wrapper

[php]
Public Class Form1
'Random Information
'Random Information
'Random Information to happen in between Class
'Random Information
'Random Information
End Class
[/php]


In html, the concept is similar to tables

[php]
<table> = Public Class Form1
</table> = End Class
[/php]

I was going to go into great detail comparing <tr> and <td> and <div> to the elements of an application, But I am to lazy.

#10 · edited 16y ago · 16y ago
UB
ubanooba
Okay at the moment my code looks like this (Making an AC to practice)

Code:
Imports System.Runtime.InteropServices
Public Class Form1
    <DllImport("user32.dll", CharSet:=CharSet.Auto, setLastError:=True)> _
    Public Function GetAsyncKeyState(ByVal vKey As Integer) As Short
    End Function
   
 Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
    Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags _
 As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons _
 As Long, ByVal dwExtraInfo As Long)
    
    Private Const MOUSELEFTDOWN = &H2 '  left button down 
   
    Private Const MOUSELEFTUP = &H4 '  left button up
++ more obviously but that's the start and I'm getting this error:

Code:
Error	1	'System.Runtime.InteropServices.DllImportAttribute' cannot be applied to instance method.
EDIT: forgot to add that the "blue squiggly underlined" section is the "GetAsyncKeySet" from
Code:
Public Function GetAsyncKeyState(ByVal vKey As Integer) As Short
#11 · edited 16y ago · 16y ago
UB
ubanooba
Okay I'm sorry to sound like a complete retard but what exactly are you trying to say?
#12 · 16y ago
NextGen1
NextGen1
nvm, just explaining format.

You can remove the applied line
Code:
<DllImport("user32.dll", CharSet:=CharSet.Auto, setLastError:=True)> _
try it with just this

[php]
Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
[/php]

The code in the sample I gave is specifically for 64 bit systems where the standard method is not working.
#13 · edited 16y ago · 16y ago
UB
ubanooba
Yes I'm on a 64 bit system and the standard method is sure as hell not working. Been 2 hours trying to find a solution and still stuck.
#14 · 16y ago
NextGen1
NextGen1
Ok, try this....

You can remove the applied line
Code:
<DllImport("user32.dll", CharSet:=CharSet.Auto, setLastError:=True)> _
try it with just this

[php]
Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
[/php]
So it should be this

[php]
Imports System.Runtime.InteropServices
Public Class Form1
Public Function GetAsyncKeyState(ByVal vKey As Integer) As Short
End Function

'Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags _
As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons _
As Long, ByVal dwExtraInfo As Long)

Private Const MOUSELEFTDOWN = &H2 ' left button down

Private Const MOUSELEFTUP = &H4 ' left button up

[/php]

#15 · edited 16y ago · 16y ago
Posts 1–15 of 28 · Page 1 of 2

Post a Reply

Similar Threads

  • i need help with hotkeys...[SOLVED]By NeOxx in CrossFire Help
    3Last post 16y ago
  • [Help] Global Hotkey [Solved]By karldeovbnet in Visual Basic Programming
    6Last post 15y ago
  • [Help]Easy Global hotkeys[Solved]By jaake in Visual Basic Programming
    7Last post 16y ago
  • [HELP]Hotkeys[Solved]By luckie12 in Visual Basic Programming
    3Last post 16y ago
  • [HELP]Hotkeys[Solved]By dylan40 in Visual Basic Programming
    16Last post 16y ago

Tags for this Thread

None