Results 1 to 14 of 14
  1. #1
    redarr's Avatar
    Join Date
    Aug 2007
    Posts
    47
    Reputation
    10
    Thanks
    6

    Vb (hotkey) Help

    When i try to make a hot key i get this error:


    Compile Error:
    Sub Or Function not Defined

    I put this code in timer at interval 1:

    Code:
    Private Sub Timer1_Timer()
    If GetKeyPress(vbKeyAButton) Then
    Shape1.BackColor = &HFF&
    End Sub

  2. #2
    redarr's Avatar
    Join Date
    Aug 2007
    Posts
    47
    Reputation
    10
    Thanks
    6
    HELP ME PLZ

  3. #3
    redarr's Avatar
    Join Date
    Aug 2007
    Posts
    47
    Reputation
    10
    Thanks
    6
    help meeeeeeeeeeeeeeeeeeeeee

  4. #4
    jaqq3000's Avatar
    Join Date
    Sep 2007
    Posts
    123
    Reputation
    10
    Thanks
    9
    Stop spamming.. -.-

  5. #5
    redarr's Avatar
    Join Date
    Aug 2007
    Posts
    47
    Reputation
    10
    Thanks
    6
    Well This is useless then noe helps me

  6. #6
    sukh13's Avatar
    Join Date
    Aug 2007
    Gender
    male
    Posts
    64
    Reputation
    10
    Thanks
    7
    Quote Originally Posted by redarr View Post
    When i try to make a hot key i get this error:


    Compile Error:
    Sub Or Function not Defined

    I put this code in timer at interval 1:

    Code:
    Private Sub Timer1_Timer()
    If GetKeyPress(vbKeyAButton) Then
    Shape1.BackColor = &HFF&
    End Sub
    try this way -----put interval to "100"

    Code:
    If GetKeyPress(vbKeyControl) And GetKeyPress(vbKeyD) Then
    Command1_Click
    End If

  7. #7
    redarr's Avatar
    Join Date
    Aug 2007
    Posts
    47
    Reputation
    10
    Thanks
    6
    OMFG... It WONT WORK I h8 my Self Same Prob

  8. #8
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    Quote Originally Posted by redarr View Post
    OMFG... It WONT WORK I h8 my Self Same Prob
    What doesn't work?!, and don't me emo, thats my job -_-.



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  9. #9
    suticox's Avatar
    Join Date
    Oct 2007
    Posts
    8
    Reputation
    10
    Thanks
    2
    OMG lol vbKeyAButton doesnt exist use vbKeyA

  10. #10
    Feniks's Avatar
    Join Date
    Sep 2007
    Posts
    45
    Reputation
    10
    Thanks
    0
    I have this problem too help

  11. #11
    wr194t's Avatar
    Join Date
    Jul 2007
    Gender
    male
    Location
    Guess.
    Posts
    3,016
    Reputation
    21
    Thanks
    361
    My Mood
    Hot
    Make sure your timer interval is 1 and use this code:
    Code:
    Private Sub Timer1_Timer()
    If GetKeyPress(vbKeyA) Then
    Shape1.BackColor = &HFF&
    End If
    End Sub

  12. #12
    sukh13's Avatar
    Join Date
    Aug 2007
    Gender
    male
    Posts
    64
    Reputation
    10
    Thanks
    7
    Quote Originally Posted by suticox View Post
    OMG lol vbKeyAButton doesnt exist use vbKeyA
    then use this way
    Code:
    If GetKeyPress(vbKeyControl) Then
     and put u r call write here

  13. #13
    blipi's Avatar
    Join Date
    Jun 2007
    Gender
    male
    Posts
    88
    Reputation
    10
    Thanks
    25
    My Mood
    Amused
    lol, have u declared the API?

    If not on top of the code:
    private declare function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer

  14. #14
    ~claw~'s Avatar
    Join Date
    May 2007
    Gender
    male
    Location
    In my room 0.o
    Posts
    849
    Reputation
    11
    Thanks
    25
    LOL YOU KIDDING ME?
    it should be:
    Code:
    If GetKeyPress(vbKeyA) then

Similar Threads

  1. Hotkey help.
    By XxTylerxX in forum C# Programming
    Replies: 10
    Last Post: 05-15-2010, 12:14 AM
  2. VB08 HOTkey (help)
    By boyd45 in forum Visual Basic Programming
    Replies: 3
    Last Post: 06-21-2008, 02:22 PM
  3. [HELP] VB6 Hotkey for Zoom not working
    By SteeL in forum WarRock - International Hacks
    Replies: 13
    Last Post: 11-10-2007, 03:06 AM
  4. [Help]With Hotkeys..
    By dor619 in forum Visual Basic Programming
    Replies: 2
    Last Post: 10-14-2007, 12:03 PM
  5. [Help] How do i set a hotkey to Scope?
    By wr194t in forum Visual Basic Programming
    Replies: 9
    Last Post: 09-27-2007, 04:53 PM