by Kamen (2 Submissions)
Category: Object Oriented Programming (OOP)
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (11 Votes)
A short but handy and useful class module
Desable/Enable Ctrl + Alt + del
Show/ Hide application from Ctrl + Alt + Del list
This is my second submission and it is quite short too so please vote for me or write some comments
API DeclarationsOption Explicit
'Put this in class module
'
'A Class module for the Ctrl + Alt + Del features:
'Remove app from the list
'Restore app to list
'Disable/Enable Ctrl + Alt + Del
'Ex.
'
'Sub A()
'Dim C As New CtrlAltDel
'
'C.RemoveFromList 'remove your application
' 'from the list
'End Sub
'
'Send comments and ideas to [email protected]
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 Declare Function GetCurrentProcessId _
Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess _
Lib "kernel32" ( _
ByVal dwProcessID As Long, _
ByVal dwType As Long _
) As Long
Const SPI_SCREENSAVERRUNNING = 97
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Public Sub RemoveFromList()
Dim lngProcessID As Long
lngProcessID = GetCurrentProcessId
Call RegisterServiceProcess(lngProcessID, RSP_SIMPLE_SERVICE)
End Sub
Public Sub RestoreToList()
Dim lngProcessID As Long
lngProcessID = GetCurrentProcessId()
Call RegisterServiceProcess(lngProcessID, RSP_UNREGISTER_SERVICE)
End Sub
Public Sub Disable()
Dim cad As Boolean
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, _
True, cad, 0)
End Sub
Public Sub Enable()
Dim cad As Boolean
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, _
False, cad, 0)
End Sub
'this stays on the form
Private Sub cmdHide_Click()
Dim C As New CtrlAltDel
C.RemoveFromList 'this hide your application
'from the list
End Sub