Important alert: (current site time 7/16/2013 4:12:28 AM EDT)
 

VB icon

Disable/Enable CTRL+ALT+DEL

Email
Submitted on: 3/12/1999
By: King Patrik the Zerg 
Level: Not Given
User Rating: By 2 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 59335
 
     ' 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!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' 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
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=1494&lngWId=1'for details.'**************************************

' 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


Other 1 submission(s) by this author

 


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

4/15/1999 4:03:00 PMJosé Angel Soriano Glez.

Esta Super la pagina
(If this comment was disrespectful, please report it.)

 
4/16/1999 11:38:00 PMLeo McGraw

Hey this was neat. It looks like one of the questions we did out of our book in computer science I today. Except mine didn't work 100%. Thanks for the answer.
(If this comment was disrespectful, please report it.)

 
4/18/1999 10:18:00 PMOwen

I got a idea try useing other keys like pressing "A", etc button it would be cooler too
(If this comment was disrespectful, please report it.)

 
4/21/1999 9:28:00 AMed

this would be a kewl program to use
but, i am getting the error that says:

"...not allowed as public members of object modules"

what can i do to fix this?
(If this comment was disrespectful, please report it.)

 
4/23/1999 2:25:00 PMWow

Doesn't work on NT
(If this comment was disrespectful, please report it.)

 
7/25/1999 10:07:00 PMsmoke33

Works great to keep people from shutting down my server for my remote administration software.
(If this comment was disrespectful, please report it.)

 
7/31/1999 12:43:00 AMJonathan Feucht

This is great! Think of all the great bugs you can create with this.
(If this comment was disrespectful, please report it.)

 
8/3/1999 9:22:00 AMDr.Anarchyst

Very usefull code. Now this is great when you block the ctrl-alt-del functions and you load a program like I don`t know....
(If this comment was disrespectful, please report it.)

 
9/7/1999 1:03:00 AMGary McAllister

See we are back to the DOESN'T work under NT .. Situation. So is anyone here any good at re-writing dlls and if so re-write the Gina.dll under NT4 and re-write it so you can intercept CTRL ALT DEL Hopes this helps with the nagging people ..

(If this comment was disrespectful, please report it.)

 
9/12/1999 12:21:00 AMbeaven

Its working great on windows 95, 98. but is there any way to work the same thing on NT?
(If this comment was disrespectful, please report it.)

 
9/16/1999 1:57:00 PMGlenn Fishwick

It isn't possible to do the same thing in NT as CTRL+ALT+DEL causes an hardware interupt in NT to protect NT from hackers trying to intercept users passwords - ie. using a trojan horse type program.
(If this comment was disrespectful, please report it.)

 
9/17/1999 4:08:00 PMJerry piere

the porgram works very well but How
you diable the windows keys in windows
95/98 and NT.
(If this comment was disrespectful, please report it.)

 
11/10/1999 10:33:00 AMVaViN

Does not work on NT (Server/Workstation)
(If this comment was disrespectful, please report it.)

 
12/23/1999 6:32:17 PMorion

Ok - the boolean variable (Dim AyW As Integer Dim TurFls As Boolean AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0)) give me a Type Mismatch error, whether i put it in a function or directly on the app itself. why is this, and can i use CStr(1) instead of the boolean? I tried, and it works, but, i can't enable the CTRLALTDEL screen. Help.
(If this comment was disrespectful, please report it.)

 
1/9/2000 12:40:03 AMJan Nawara

Thank you for rewriting my code. :) Just search for "Exclusive Mode" to see my code. You will notice that my code is a lot simpler (and smaller) and does the same identical thing as yours. Plus it was written almost 15 months earlier. I don't mind you rewriting my original code but hope you (and everyone else) will take a look at my code as well.
(If this comment was disrespectful, please report it.)

 
2/18/2000 5:31:18 AMEpos

Looks like bullsh** !
Code doesn't work ... not really ...
(If this comment was disrespectful, please report it.)

 
4/7/2002 1:13:15 PMAdrian

Email me if you can make it work in Win Xp
(If this comment was disrespectful, please report it.)

 
3/18/2003 9:47:06 PMPsyc

hey, i can't find the sub/function for disabling ctrl+alt+del! :(
(If this comment was disrespectful, please report it.)

 
4/4/2004 6:16:53 AM

http://www.meliorasoft.com/kits/keyboard/
(If this comment was disrespectful, please report it.)

 
12/15/2004 1:43:27 PM

There is a misspelling in the Disable_Ctrl_Alt_Del() where AwY is declared as AyW
2nd thing, I am using this VB.NET and I am getting errror on
(If this comment was disrespectful, please report it.)

 
12/15/2004 1:43:55 PM

There is a misspelling in the Disable_Ctrl_Alt_Del() where AwY is declared as AyW
2nd thing, I am using this VB.NET and I am getting errror on "ByVal lpvParam As Any". It says "Any is not supported in Declare statement

(If this comment was disrespectful, please report it.)

 

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.