AutoHotkey Community

It is currently May 24th, 2012, 2:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: January 14th, 2007, 4:53 am 
Offline

Joined: June 27th, 2006, 2:38 pm
Posts: 385
Location: Canada
Just thought I would post this incase anyone needs it..
Code:
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 5:11 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
This begs the question... why on earth would you want to disable Ctrl-Alt-Delete? Isn't that kinda dangerous?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 9:48 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
People asked this...
Perhaps to make scripts unstoppable. One can then question the motivation behind this need...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 11:38 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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::.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 11:52 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
jonny wrote:
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.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 5:08 pm 
Offline

Joined: June 27th, 2006, 2:38 pm
Posts: 385
Location: Canada
Titan wrote:
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: WinLockDll
PostPosted: January 15th, 2007, 2:23 am 
Offline

Joined: July 30th, 2004, 8:50 pm
Posts: 192
:) 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

Code:
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")


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 15th, 2007, 6:29 am 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
PhiLho wrote:
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.......

_________________
Joyce Jamce


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 3:38 pm 
Offline

Joined: November 14th, 2006, 4:40 pm
Posts: 16
You can also force closing of taskmanager(s).
Code:
#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

_________________
Don't capture me again!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2007, 3:53 pm 
Offline

Joined: June 27th, 2006, 2:38 pm
Posts: 385
Location: Canada
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2007, 5:46 pm 
jonny wrote:
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:


Report this post
Top
  
Reply with quote  
 Post subject: Re: WinLockDll
PostPosted: September 21st, 2007, 1:38 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
skrommel wrote:
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.)

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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 21st, 2007, 8:42 pm 
Quote:
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...]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2007, 2:34 am 
Offline

Joined: October 29th, 2006, 4:09 am
Posts: 39
Location: A2 MI
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2007, 4:25 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
Alt+F4 is much easier:
Code:
!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.)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], xXDarknessXx and 26 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group