Results 1 to 3 of 3

Thread: hot key help

  1. #1

    Thread Starter
    Addicted Member ][KMX]['s Avatar
    Join Date
    Sep 2001
    Location
    20,000 Leagues under the sea
    Posts
    150

    Unhappy hot key help

    I've tried just about everything, but I can't get this code to work... Help Me! Please!!!!!

    Const VK_ESCAPE = &H1B
    Const VK_CONTROL = &H11
    Const VK_SHIFT = &H10
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

    Private Sub Timer1_Timer()
    If GetAsyncKeyState(vbKeyControl) Then
    If GetAsyncKeyState(VK_SHIFT) Then
    If GetAsyncKeyState(vbKeyEscape) Then
    MsgBox "Ctrl+Shift+Esc pressed"
    End If
    End If
    End If
    End Sub

    Please post instructions... Thanks

  2. #2
    Member DDfunbags's Avatar
    Join Date
    Aug 2001
    Location
    Isle of Wight, England
    Posts
    50
    It worked for me, except it jumped to Taskmanager (or was that the problem?)
    I ain't the best coder,
    I ain't the worst coder

    Messanger Handle : FBz

  3. #3
    AutoBot
    Guest

    Try This

    I'm on xp so I had to change the code, I think you forgot to enable the timer so try this code it works:

    Const VK_CONTROL = &H11
    Const VK_SHIFT = &H10
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

    Private Sub Form_Load()

    Timer1.Enabled = True
    Timer1.Interval = 100

    End Sub

    Private Sub Timer1_Timer()

    If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(VK_SHIFT) Then

    MsgBox "Ctrl+Shift Pressed"

    End If

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width