Results 1 to 3 of 3
  1. #1
    ajvpot's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    139
    Reputation
    10
    Thanks
    39

    Question [Help]Virtual Keys

    I am in too deep with this. I have an integer that points to a KBDLLHOOKSTRUCT structure.
    Here is the code for the structure:
    Code:
        Private Structure KBDLLHOOKSTRUCT
            Public vkCode As Integer ' virtual key code
            Public scanCode As Integer ' scan code
            Public flags As Integer ' flags
            Public time As Integer ' time stamp for thismessage
            Public dwExtraInfo As Integer ' extra info from the driver or keybd_event
        End Structure
    How do i get virtual key code from this? Here is the full code.
    Code:
        Private Structure KBDLLHOOKSTRUCT
            Public vkCode As Integer ' virtual key code
            Public scanCode As Integer ' scan code
            Public flags As Integer ' flags
            Public time As Integer ' time stamp for thismessage
            Public dwExtraInfo As Integer ' extra info from the driver or keybd_event
        End Structure
    
        Private Const LLKHF_ALTDOWN = 32
        Private Const HC_ACTION = 0
    
    
        Public Delegate Function CallBack( _
        ByVal idHook As Integer, _
        ByVal wParam As Integer, _
        ByVal lParam As Integer) As Integer
    
    
        Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
        Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Integer) As Integer
        Public Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Integer, ByVal ncode As Integer, ByVal wParam As Long, ByVal lParam As Integer) As Integer
        Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Integer, ByVal lpfn As CallBack, ByVal hmod As Integer, ByVal dwThreadId As Integer) As Integer
    
        Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Integer) As Integer
        Public Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory" (ByRef struct As Object, ByVal ptr As Integer, ByVal cb As Integer)
    
        Private hHook As Integer
        Private CTRLDown As Boolean
        Private pkbhs As New KBDLLHOOKSTRUCT()
    
        ' wParam - Specifies the identifier of the
        ' keyboard message.
        ' This parameter can be one of the
        ' following messages:
        ' WM_KEYDOWN,WM_KEYUP,WM_SYSKEYDOWN,
        ' or WM_SYSKEYUP.
        ' lParam - pointer to KBDLLHOOKSTRUCT structure
    
        Private hookproc As CallBack
    
    
        Private Function LowLevelKeyboardProc(ByVal idHook As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
            Try
                msgbox "VK CODE NEEDS TO GO HERE"
                LowLevelKeyboardProc = CallNextHookEx(hHook, idHook, wParam, lParam)
            Catch ex As Exception
                ErrorBox.Text = "Error: " + ex.Message
                ErrorPanel.Show()
            End Try
        End Function
    
        Public Sub HookKeyboard()
            Dim hinstance As Integer = System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly.GetModules()(0)).ToInt32
            hHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, hinstance, 0&)
    
        End Sub
        Public Sub UnHookKeyboard()
            'remove the windows-hook
            Call UnhookWindowsHookEx(hHook)
        End Sub
    [IMG]https://************.com/sig/020/ajvpot.jpg[/IMG]
    [img]https://************.com/sig/020/Bommer.jpg[/img]
    ^^LEGIT ACCOUNTS ^^
    [IMG]https://************.com/sig/020/banned2m0rr0.jpg[/IMG]
    ^^HACKER ACCOUNT^^

  2. #2
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Changed Title, Read rules for this section.

    Also , Please explain what it is you need exactly, I'll be honest, I am lost,
    ]
    is there an error or whats going on here.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  3. #3
    ajvpot's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    139
    Reputation
    10
    Thanks
    39
    I need to find the VK code pressed when the LowLevelKeyboardProc event is triggered.
    [IMG]https://************.com/sig/020/ajvpot.jpg[/IMG]
    [img]https://************.com/sig/020/Bommer.jpg[/img]
    ^^LEGIT ACCOUNTS ^^
    [IMG]https://************.com/sig/020/banned2m0rr0.jpg[/IMG]
    ^^HACKER ACCOUNT^^

Similar Threads

  1. [Help] Tap Key Press Twice?
    By mastermods in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 4
    Last Post: 07-24-2010, 06:54 AM
  2. [Help]Toggle Key[Solved]
    By Alroundeath in forum Visual Basic Programming
    Replies: 5
    Last Post: 04-23-2010, 08:18 AM
  3. help prduct key using vmware to run 2 crossfires
    By dad4r in forum CrossFire Hacks & Cheats
    Replies: 5
    Last Post: 03-13-2010, 11:38 PM
  4. Please help virtual jump
    By barakjan in forum Combat Arms Europe Hacks
    Replies: 10
    Last Post: 04-08-2009, 07:27 AM
  5. Please help virtual jump
    By barakjan in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 04-07-2009, 01:15 AM