Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Solution - Blocking Ctrl+Alt+Delete


  • Please log in to reply
29 replies to this topic
Conquer
  • Members
  • 385 posts
  • Last active: Jan 10 2013 02:14 AM
  • Joined: 27 Jun 2006
Just thought I would post this incase anyone needs it..
OnExit, ExitSub

#1::
gosub Enable
return

#2::
gosub Disable
return

Disable:
Regwrite, REG_SZ, HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe, Debugger, Hotkey Disabled
return

Enable:
RegDelete,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe
return

ExitSub:
RegDelete,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe
ExitApp
return

Hotkeys:
Win+1 Enable Ctrl+Alt+Del
Win+2 Disable Ctrl+Alt+Del

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
This begs the question... why on earth would you want to disable Ctrl-Alt-Delete? Isn't that kinda dangerous?

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
People asked this...
Perhaps to make scripts unstoppable. One can then question the motivation behind this need...

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
There could be a legitimate use. For instance, a teacher in a typing class might need to keep mischievous students from messing with the system. AutoHotkey can't block Ctrl-Alt-Delete simply by hooking that sequence with ^!Delete::.

polyethene
  • Administrators
  • 5517 posts
  • Last active: Jun 02 2014 02:21 AM
  • Joined: 26 Oct 2012

There could be a legitimate use. For instance, a teacher in a typing class might need to keep mischievous students from messing with the system.

Even if Ctrl+Alt+Delete is disabled Ctrl+Shift+Esc will still work. There are better ways to block Task Manager.

Conquer
  • Members
  • 385 posts
  • Last active: Jan 10 2013 02:14 AM
  • Joined: 27 Jun 2006

Even if Ctrl+Alt+Delete is disabled Ctrl+Shift+Esc will still work. There are better ways to block Task Manager.


If you use my blocking method, Ctrl+Shift+Esc is blocked also.

This is helpful for example in a computer lock program where you dont want someone to kill the process of your locking script.

skrommel
  • Members
  • 193 posts
  • Last active: Jun 07 2010 08:30 AM
  • Joined: 30 Jul 2004
:) Or you could use WinLockDll from CodeGuru. Download and extract the WinLockDll.dll file and place it with the script.

Only drawback is that is seems to need a restart to enable ^!{Del} again...

Skrommel

DllCall("WinLockDll.dll\Desktop_Show_Hide",UInt,0)
DllCall("WinLockDll.dll\Taskbar_Show_Hide",UInt,0)
DllCall("WinLockDll.dll\TaskSwitching_Enable_Disable",UInt,0)
DllCall("WinLockDll.dll\TaskManager_Enable_Disable",UInt,0)
DllCall("WinLockDll.dll\CtrlAltDel_Enable_Disable",UInt,0)
MsgBox
DllCall("WinLockDll.dll\Desktop_Show_Hide",UInt,1)
DllCall("WinLockDll.dll\Taskbar_Show_Hide",UInt,1)
DllCall("WinLockDll.dll\TaskSwitching_Enable_Disable",UInt,1)
DllCall("WinLockDll.dll\TaskManager_Enable_Disable",UInt,1)
DllCall("WinLockDll.dll\CtrlAltDel_Enable_Disable",UInt,1)
MsgBox
DllCall("WinLockDll.dll\Process_Desktop", "str", "MyDesktop2", "str", "Calc.exe")


Joy2DWorld
  • Members
  • 562 posts
  • Last active: Jun 30 2014 07:48 PM
  • Joined: 04 Dec 2006

People asked this...
Perhaps to make scripts unstoppable. One can then question the motivation behind this need...



There are some nice programs for Infants.... based on basic a-z keys mapped to a kiddie keyboard (like "comfy" brand).... if you use the hardware kiddie keyboard... all is ok.... but if you also have a regular keyboard handy.... (ie. within toddler's reach)....


GOSH IT'S NICE TO BE ABLE TO TURN OFF CTRL-ALT-DELETE.... !



which is to say...



legit need to turn off ctrl-alt-delete..




amazing what pounding little fingers find.... and how delightful it is to make all the lights change on the computer box.......

FabianBengtsson
  • Members
  • 18 posts
  • Last active: Oct 15 2013 08:31 AM
  • Joined: 14 Nov 2006
You can also force closing of taskmanager(s).
#Persistent
#NoTrayIcon 
SetTimer, CloseEscapeAttempts, 250
return

CloseEscapeAttempts:
    Process, Exist, PROCEXP.EXE
 If ( errorlevel > 0 )
    Process, Close, PROCEXP.EXE
    
    Process, Exist, taskmgr.exe
 If ( errorlevel > 0 )
    Process, Close, taskmgr.exe

return


Conquer
  • Members
  • 385 posts
  • Last active: Jan 10 2013 02:14 AM
  • Joined: 27 Jun 2006
Yes, however having a timer execute every 250 ms takes up some Mem Usage, and that script needs to be run on its own, so a user can tamper with that file and possibly remove it. Thats why I chose regwrite.

majkinetor !
  • Guests
  • Last active:
  • Joined: --

This begs the question... why on earth would you want to disable Ctrl-Alt-Delete? Isn't that kinda dangerous?

You are full of dangerous questions, jonny.... :lol:

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

Only drawback is that is seems to need a restart to enable ^!{Del} again...

Looks like have to keep WinLockDll loaded, i.e., need to keep the original winproc. (I think this problem can be easily overcome by adding some check in the code.)

DllCall("LoadLibrary", "str", "WinLockDll")
DllCall("WinLockDll\CtrlAltDel_Enable_Disable", "int", False)
MsgBox, CtrlAltDel Disabled! Try to press CtrlAltDel.
DllCall("WinLockDll\CtrlAltDel_Enable_Disable", "int", True)
MsgBox, CtrlAltDel Enabled! Try again CtrlAltDel.


BoBo¨
  • Guests
  • Last active:
  • Joined: --

Lock Windows Desktop

By Antnio Feijo.
Restricting Windows access by hiding desktop windows --> and disabling special keys. :twisted:

Note:
In response to the many requests from VB (and other languages) coders, I finally took some time to update the project and move all the functions into a DLL so that any program developed in a language capable of calling Windows standard libraries (DLLs) can use them. To demonstrate these functions, I also included C and a VB projects.

Introduction:
I manage a system where I need to restrict users from accessing the desktop and running other applications. The search for ways to achieve this returned several different techniques. Although in the end I didn't use any of the techniques described here, I decided to compile all the code in one application for everyone who should need it.

[More...]



Gertlex
  • Members
  • 39 posts
  • Last active: Apr 26 2011 11:38 PM
  • Joined: 29 Oct 2006
Edit: Somehow I botched my testing and fooled my self rather majorly... (original post tinyfied below)

Can a similar thing be done to prevent the Alt + F4 combo?

Here's a use for it....

I have a Logitech Keypad (Bluetooth diNovo MediaPad... not sold separately, cept on ebay) that has a crazy "navigation" scheme (as well as numpad, and calculator) where 987654321 are mapped Browser-Forward, Up, Browser-Back, right, down, left, Close, Windows Key, Open (return)

The Close key is a one touch Ctrl Alt Del... It's annoying if i accidentally hit it when using the keypad to drive my Bluetooth R/C car (shameless plug). Crashes the controlling program, naturally.

This script disables it temporarily :D


Lexikos
  • Administrators
  • 9441 posts
  • Last active:
  • Joined: 17 Oct 2006
Alt+F4 is much easier:
!F4::return
Interesting link, BoBo. One of the methods used switches to a new desktop - something I've been meaning to try in AutoHotkey since the first time I heard "kiosk mode" in Ask for Help. A while before I came across AutoHotkey, I managed to trap myself in a new blank desktop from C#. I had to restart the computer to get out. :lol:

Note that you can start other processes in a desktop you create with CreateDesktop(). (Ideal for kiosk mode.)