Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32
  1. #16
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by NextGen1 View Post
    Long becomes Integer, Integer becomes Short

    Cryptic enough for you?

    Code:
        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
    Something like that? The red shows what will be changed. And if that is right, will you explain why?
    Trying to learn as I go... Would be stupid to get the solution and not understand why it was wrong in the first place.
    Last edited by Alroundeath; 04-22-2010 at 03:10 PM.

  2. #17
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by Alroundeath View Post
    Code:
        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
    Something like that? The red shows what will be changed. And if that is right, will you explain why?
    Yes, that is correct. I cannot explain you though =D



  3. #18
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Long was 32-bits wide , but in VB.NET Integer is 32-bits wide.

    So Make those changes or it also may work

    [php]
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Short
    [/php]

    Let us know if it works

  4. #19
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by Blubb1337 View Post
    Yes, that is correct. I cannot explain you though =D
    Is it based on operating system, why this is changed around? Because
    I looked at the original guide thread, and I'm guessing, since people
    are asking him to make it compatible with different bit CPU's changing the
    integers and stuff... Idk, getting confused. But long story short, is it based
    from the CPU?

    Like x64 and x32 Use different coding 'methods'?

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Edit:

    Code:
    Module Module1
        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Short
        Public Sub HotKey(ByVal hotkey As Boolean)
            HotKey = GetAsyncKeyState(Keys.Insert) 'Change to any hotkey
            If hotkey = True Then
                'Do something
                'add your code here when the hotkey is pressed
            End If
        End Sub
    End Module
    That's what I have, I get no errors, BUT the hotkey doesn't work.

    If you have time and you're willing to, you can get on TeamViewer.
    Last edited by Alroundeath; 04-22-2010 at 03:16 PM.

  5. #20
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Yes, OS & CPU can play a Factor in the API.

    What matters now though is if it works for the OP

    More specifically is windows 7


  6. #21
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Atleast in this case, yes.

    However x64 bit codes(in case of hotkeys) als work on x32 bit systems.


    Working on x32 bit only:

    Code:
     Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
    Working on x32/x64 bit:

    Code:
     Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
    I will leave the further talking to nextgen, cuz I'm just a little noob and he's the expert



  7. #22
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Unless it's windows 7 64bit

    try this

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

    See if you get an error and see if the hotkey works

  8. #23
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    I thought it's:

    Code:
     Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
    for a x64 bit system. Or doesn't it matter?



  9. #24
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by NextGen1 View Post
    Unless it's windows 7 64bit

    try this

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

    See if you get an error and see if the hotkey works
    No error, no response for the hotkeys. =/

  10. #25
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Did you enable your timer?



  11. #26
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by Blubb1337 View Post
    Did you enable your timer?
    Yes, I've enabled my timer BUT when I get into the program, It's already doing the command per tick. Is it supposed to do that? =/

  12. #27
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    I think we all need to take a step back, post your Full Code as it is right now.

  13. #28
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by NextGen1 View Post
    I think we all need to take a step back, post your Full Code as it is right now.
    Code:
    Public Class Form1
    
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Timer1.Enabled = True
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Timer1.Enabled = False
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Timer2.Enabled = True
    
        End Sub
    
        Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
            Timer2.Enabled = False
        End Sub
    
        Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Timer1.Interval = Convert.ToInt32(TextBox2.Text)
    
        End Sub
    
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Timer1.Interval = Convert.ToInt32(TextBox1.Text)
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            SendKeys.Send(TextBox1.Text)
            SendKeys.Send("{Enter}")
            HotKey(True)
        End Sub
    
        Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
            SendKeys.Send(TextBox2.Text)
            SendKeys.Send("{Enter}")
        End Sub
        Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
            Timer1.Interval = Convert.ToInt32(TextBox2.Text)
        End Sub
    
        Private Sub ComboBox2_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
            Timer1.Interval = Convert.ToInt32(TextBox1.Text)
        End Sub
    
        Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click
    
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        End Sub
    End Class
    <--Form1.vb


    Code:
    Module Module1
        Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
        Public Sub HotKey(ByVal hotkey As Boolean)
            hotkey = GetAsyncKeyState(Keys.F7) 'Change to any hotkey
            If hotkey = True Then
            End If
        End Sub
    End Module
    <--Module

  14. #29
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    I'd rather use

    Code:
    Timer1.Interval = Val(Textbox1.Text)
    instead of

    Code:
    Timer1.Interval = Convert.ToInt32(TextBox2.Text)
    // do not enable any of the timers.

    Code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Timer1.enabled = false
    Timer2.enabled = false
        End Sub
    --------------------------------------------------

    Try this

    Code:
    Public Class Form1
    
    
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Timer2.Enabled = True
    
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Timer2.Enabled = False
        End Sub
    
        Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Timer1.Interval = Val(TextBox2.Text)
    
        End Sub
    
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Timer1.Interval = Val(TextBox1.Text)
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Dim f7 as boolean
           f7 = getasynckeystate(key.f7)
           if f7 = true then
           if timer2.enabled = false then
           timer2.enabled = true
           else
           timer2.enabled = false
           end if
           end if
        End Sub
    
        Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
            SendKeys.Send(TextBox2.Text)
            SendKeys.Send("{Enter}")
        End Sub
        Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
            Timer1.Interval = Val(TextBox2.Text)
        End Sub
    
        Private Sub ComboBox2_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
            Timer1.Interval = Val(TextBox1.Text)
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.enabled = true
        timer2.enabled = false
        End Sub
    End Class
    Delete button3/button4.

    Delete your module.
    Last edited by Blubb1337; 04-22-2010 at 03:55 PM.



  15. #30
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by Blubb1337 View Post
    I'd rather use

    Code:
    Timer1.Interval = Val(Textbox1.Text)
    instead of

    Code:
    Timer1.Interval = Convert.ToInt32(TextBox2.Text)
    // do not enable any of the timers.

    Code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Timer1.enabled = false
    Timer2.enabled = false
        End Sub
    --------------------------------------------------

    Try this

    Code:
    Public Class Form1
    
    
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Timer2.Enabled = True
    
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Timer2.Enabled = False
        End Sub
    
        Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Timer1.Interval = Val(TextBox2.Text)
    
        End Sub
    
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Timer1.Interval = Val(TextBox1.Text)
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Dim f7 as boolean
           f7 = getasynckeystate(key.f7)
           if f7 = true then
           if timer2.enabled = false then
           timer2.enabled = true
           else
           timer2.enabled = false
           end if
           end if
        End Sub
    
        Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
            SendKeys.Send(TextBox2.Text)
            SendKeys.Send("{Enter}")
        End Sub
        Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
            Timer1.Interval = Val(TextBox2.Text)
        End Sub
    
        Private Sub ComboBox2_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
            Timer1.Interval = Val(TextBox1.Text)
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.enabled = true
        timer2.enabled = false
        End Sub
    End Class
    Delete button3/button4.

    Delete your module.
    Button 3/4 and textbox 2 are being used ;o

    I'll just start from scratch again... =/
    Last edited by Alroundeath; 04-22-2010 at 04:07 PM.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [Solved] help could not find executable file?
    By fastdog493 in forum WarRock Help
    Replies: 4
    Last Post: 11-28-2011, 03:26 PM
  2. [Solved] Help Me ************ Not Gave Me Any Offer...
    By ahmedrizk in forum CrossFire Help
    Replies: 5
    Last Post: 10-08-2011, 02:24 PM
  3. [SOLVED]help on not getting banned
    By jozza7 in forum Call of Duty Modern Warfare 2 Help
    Replies: 6
    Last Post: 10-02-2010, 10:07 AM
  4. [NEED HELP]Name 'EndingBanner is not declared.
    By porhaxn in forum Visual Basic Programming
    Replies: 4
    Last Post: 06-01-2010, 03:09 AM
  5. This should help you NOT get D/C anymore.
    By Tinnytim in forum Combat Arms Hacks & Cheats
    Replies: 18
    Last Post: 12-23-2008, 07:57 PM