Results 1 to 2 of 2

Thread: Blocking Keyboard input

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Post

    How do I prevent the user from using the keyboard for an interval of time during my VB application? not only do I want to prevent CTRL+ALT+DEL and the Windows keys from being pressed(which can be done using the SystemParametersInfo API) but I want to prevent any key from being used. Can anyone help me out here?

    Thanks.

  2. #2
    Addicted Member jcouture100's Avatar
    Join Date
    Aug 1999
    Posts
    141

    Post

    Since you want to disable the keyboard for a specific time
    interval during your application execution, you can set a
    flag at the beginning of the code (blnKbdDisable = True)
    and then in the KeyDown and KeyPress events add code
    similar to this ...

    'For KeyPress Event ...
    if blnKbdDisable = True then
    KeyAscii = 0
    end if

    'For KeyDown Event ...
    if blnKbdDisable = True then
    KeyCode = 0
    end if

    Then at the end of your particular time interval you can set
    the flag back to false.

    Hope this helps.
    JC

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