// JP opened flex table

Click to See Complete Forum and Search --> : a code that will disable the keyboard and mouse


New_Brink
April 27th, 2004, 05:24 PM
I need a code where it will disable the keyboard and the mouse i'm useing window's 98. please help me if you can

Cimperiali
April 28th, 2004, 06:05 AM
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Form_Activate()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
DoEvents
'block the mouse and keyboard input
BlockInput True
'wait 10 seconds before unblocking it
Sleep 10000
'unblock the mouse and keyboard input
BlockInput False
End Sub

New_Brink
April 29th, 2004, 02:55 PM
thanks do you got a code that will disable "ctrl", "alt", "delete"? that would help alot and how can i change it to where it will enable after 60 seconds instead of 10? help me if you can thanks

Cimperiali
April 30th, 2004, 07:14 AM
as far as I know, disable "ctrl", "alt", "delete" is not possible
under NT, win2k, winXp.


abut 60 seconds:

BlockInput True
'wait 60 seconds before unblocking it
Sleep 60000
'unblock the mouse and keyboard input
BlockInput False

New_Brink
May 3rd, 2004, 03:03 PM
Is there a disable for "ctrl", "alt", "delete" for windows 98? thanks for your help

Cimperiali
May 4th, 2004, 05:36 AM
On win 98 you can:

Private Const SPI_SCREENSAVERRUNNING As Long = 97
Private Declare Function SystemParametersInfo Lib "User32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long

'To disable:
'call it as
DisableEnable True

'To enable, call it as:
DisableEnable False
'remember to enable when quitting your program!

Private Sub DisableEnable(bParam As Boolean)
Dim lRetVal As Long, bOld As Boolean
lRetVal = SystemParametersInfo(SPI_SCREENSAVERRUNNING, bParam, bOld, 0&)
End Sub


Another way:
Private Declare Function RegisterServiceProcess Lib "Kernel32.dll" _
(ByVal dwProcessId As Long, ByVal dwType As Long) As Long
Sub AltCtrlDel_Show()
Call RegisterServiceProcess(0, 0)
End Sub

Sub AltCtrlDel_Hide()
Call RegisterServiceProcess(0, 1)
End Sub

//JP added flex table