'****** 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!