Click to See Complete Forum and Search --> : Locking keyboard input?
Athenis
Nov 2nd, 1999, 10:35 AM
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?
Mongo
Nov 2nd, 1999, 12:03 PM
'****** 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!
Athenis
Nov 2nd, 1999, 03:06 PM
It does block those special keys..
Now.. it would be great if mouse input could be blocked too :)
Crazy D
Nov 2nd, 1999, 03:33 PM
Note that that doesn't work in Win NT.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.