Results 1 to 4 of 4

Thread: Ctrl keydown detection! Plz HElp!!!!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    wrrj
    Posts
    26

    Post

    I need some major help here. I have posted before but nobody responded. OK, here is my problem:

    I have a login form and I have disabled Ctrl+Alt+Del, so the user cannot bring up the end task dialogue. What I need to do is detect when these keys are pressed, so I can show a 'fake' end task dialogue box

    I can use GetAsyncKeyState to test when two of the keys are pressed, but I'm having trouble testing when the alt key is pressed!!!!

    Can anyone give me some sample code or any help whatsoever? Thanks people.

    David Richardson

  2. #2
    Lively Member
    Join Date
    Jul 1999
    Posts
    99

    Post

    David Richardson

    Put this in your login form's KeyDown event

    Something like:

    ' This code was not tested.
    If Shift = vbKeyAlt* + vbKeyControl* and KeyCode = vbKeyDelete* then
    ' User pressed ctrl+alt+Del
    End If

    '* - Check your object browser for the correct names of the key constants.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    wrrj
    Posts
    26

    Post

    Thanks, I have looked at the Object browser, but as I said... i cannot detect when the Alt key is pressed as ther is no keycode constant or what have you available. This has got to be possible.... Someone... Aaron Young!!! Plz help!!!

    David Richardson

  4. #4
    Lively Member
    Join Date
    Jul 1999
    Posts
    99

    Post

    ok then, since i don't have vb in this machine, try getting help for the "KeyDown" event and look for the "Shift" parameter. the help will explain all the parameters. i'm sure there is a constant value for the alt and ctrl keys.

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