Results 1 to 4 of 4

Thread: Locking keyboard input?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Singapore
    Posts
    32

    Post

    I'm writing a little program similar to "netnanny"
    When the user surfs to a site like "http://www.xxx.com", how do I lock keyboard input so as to close the window?

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Leavenworth KS USA
    Posts
    482

    Post

    '****** In a module:

    Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long

    Private Const SPI_SCREENSAVERRUNNING = 97&

    Public Sub DisableKeys(dKeys As Boolean)
    Dim lReturn As Long
    Dim bPre As Boolean
    lReturn = SystemParametersInfo(SPI_SCREENSAVERRUNNING, dKeys, bPre, 0&)
    End Sub

    '************* Then on a form....

    Private Sub Bad_Kitty_Click()
    On Error Resume Next
    If Command1.Caption = "Disable Keys" Then
    DisableKeys True
    Command1.Caption = "Enable Keys"
    ElseIf Command1.Caption = "Enable Keys" Then
    DisableKeys False
    Command1.Caption = "Disable Keys"
    Else
    End
    End If
    End Sub


    Hope this helps!


  3. #3

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Singapore
    Posts
    32

    Post

    It does block those special keys..
    Now.. it would be great if mouse input could be blocked too

  4. #4
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    Note that that doesn't work in Win NT.

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