How can i disable the user from pressing Ctrl Alt Del? I want the only way to exit my program is by using by program to exit.
Printable View
How can i disable the user from pressing Ctrl Alt Del? I want the only way to exit my program is by using by program to exit.
This will either enable or disable Ctrl-Alt-Del from being used.
Code:Private Declare Function SystemParametersInfo Lib _
"user32" Alias "SystemParametersInfoA" (ByVal uAction _
As Long, ByVal uParam As Long, ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Sub DisableCtrlAltDelete(bDisabled As Boolean)
Dim X As Long
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
Usage:
'Disable
Call DisableCtrlAltDelete(True)
'Enable
Call DisableCtrlAltDelete(False)
That worked great thanks.
You might just want to remove your program from the tasklist. This way, they can still use CTRL+ALT+DEL for another program that freezes and your program won't be on the list.
Module:Form:Code:Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Code:Dim pid As Long
Dim regserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)