VB icon

Disable/Enable CTRL+ALT+DEL

Email
Submitted on: 1/2/2015 12:54:00 AM
By: King Patrik the Zerg (from psc cd)  
Level: Not Given
User Rating: By 2 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 6000
 
     ' This code disables/enabled CTRL+ALT+DEL pressing ' To disable CTRL+ALT+DEL, call the function Disable_CTRL_ALT_DEL ' To enabled CTRL+ALT+DEL, call the function Enable_CTRL_ALT_DEL
 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :Disable/Enable CTRL+ALT+DEL
'**************************************
'***************************************************************
'Windows API/Global Declarations for :Dissable / Enable CTRL + AL
' T + DEL
'***************************************************************
Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Const SPI_SCREENSAVERRUNNING = 97
Public Sub Disable_Ctrl_Alt_Del()
'Disables the Crtl+Alt+Del
Dim AyW As Integer
Dim TurFls As Boolean
AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0)
End Sub
Public Sub Enable_Ctrl_Alt_Del()
'Enables the Crtl+Alt+Del
Dim AwY As Integer
Dim TurFls As Boolean
AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, TurFls, 0)
End Sub
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Disable/Enable CTRL+ALT+DEL
' Description:' This code disables/enabled CTRL+ALT+DEL pressing
' To disable CTRL+ALT+DEL, call the function Disable_CTRL_ALT_DEL
' To enabled CTRL+ALT+DEL, call the function Enable_CTRL_ALT_DEL
' By: King Patrik the Zerg (from psc cd)
'**************************************

' Put this into Sub Main in a module
' Disable/Enable CTRL+ALT+DEL
'***************************************************************
' Name: Dissable / Enable CTRL + ALT + DEL
' Description:Dissable / Enable CTRL + ALT + DEL , This does just
' what it says, it disables a used from pressing CTRL+ALT+DEL. Well
' not dissables them from doing it, it just wont do anything if the
' y do. :o)This is useful in setup programs when it is important th
' ea a user not end task your program.
' By: Cy Toad
'
'
' Inputs:'Example of use:
' Call Disable_Ctrl_Alt_Del()
'Then at another time:
' Call Enable_Ctrl_Alt_Del()
'
' Returns:Dissables / Enables CTRL + ALT + DEL You wont be able t
' o use CTRL + ALT + DEL until you Enable it again, or restart your
' system.
'
'Assumes:None
'
'Side Effects:You wont be able to use CTRL + ALT + DEL until you
' Enable it again, or restart your system.
'
'Code provided by Planet Source Code(tm) (http://www.PlanetSource
' Code.com) 'as is', without warranties as to performance, fitness,
' merchantability,and any other warranty (whether expressed or impl
' ied).
'***************************************************************
Dim X
X = MsgBox("Do you wish to disable CTRL+ALT+DEL?", 36, "Disable/Enable CTRL+ALT+DEL")
If X = vbYes Then
Disable_Ctrl_Alt_Del
MsgBox "CTRL+ALT+DEL is disabled, try pressing CTRL+ALT+DEL now.", , "Disable/Enable CTRL+ALT+DEL"
Again:
X = MsgBox("Enbale CTRL+ALT+DEL now?", 36, "Disable/Enable CTRL+ALT+DEL")
If X = vbYes Then
Enable_Ctrl_Alt_Del
ElseIf X = vbNo Then
MsgBox "The program will not end before CTRL+ALT+DEL is enabled.", , "Disable/Enable CTRL+ALT+DEL"
GoTo Again
End If
End If


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.