Solved

disable ALT + CTRL + DEL

Posted on 2004-09-26
21
848 Views
Last Modified: 2010-04-16
how can i disable ALT + CTRL + DEL programmeticly .
0
Comment
Question by:jimy7s
  • 7
  • 4
  • 3
  • +5
21 Comments
 
LVL 3

Expert Comment

by:CmdrRickHunter
ID: 12156783
what platform?  Windows grabs "ctrl+alt+del" without letting any programs touch it.  This is why win2k has you hit ctrl+alt+del to log in... no program is allowed to capture or stop that combo, so the login prompt you have is guarenteed to be real
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12157432
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12158656
Bad boy! Bad, bad boy! ;-)
With Windows, you are not allowed to disable CTRL+ALT+DEL in Windows, especially not in XP. If you do manage to disable it, it will be a bug that might not be possible with the next patch or upgrade. I'm not saying it is not possible, of course. It's just that you should NOT do such a thing.

I can imagine that you don't want users to log out or turn off the computer. Well, that's why you can use policies on Windows. Let the user log on using a normal account and make sure quite a few options for this user have been turned off. Go to "Settings/Control Panel/Administrative tools/Local Security Policy" and with "Local Policies/User rights Assignments" you just make a few modifications. The policy "Shut down the system" should not include the users, for example. There are some things at "Security options" too that are interesting to modify.

Work with the system, not against it. That's a lot easier...
0
 
LVL 1

Expert Comment

by:Comboy
ID: 12159760
Here it is:
procedure DisableTaskMgr;
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  reg.RootKey := HKEY_CURRENT_USER;
  reg.OpenKey('Software', True);
  reg.OpenKey('Microsoft', True);
  reg.OpenKey('Windows', True);
  reg.OpenKey('CurrentVersion', True);
  reg.OpenKey('Policies', True);
  reg.OpenKey('System', True);
  reg.WriteString('DisableTaskMgr', '1');
  reg.CloseKey;
end;
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12160816
that specific combination is owned by the OS in Windows 2000, XP and 2003 and "cannot" be disabled, the way to disable it correctly is kinda complicated, you have to replace the GINA.DLL, which is in charge of the logging mechanism to Windows itself, you'll find good information at microsoft.com about this topic

http://search.microsoft.com/search/results.aspx?st=b&na=88&View=en-us&qu=gina.dll
0
 
LVL 5

Accepted Solution

by:
Hypoviax earned 50 total points
ID: 12165266
Why dont you just hook those keys. You can use code like this:

if ((GetAsyncKeyState($+162) and 1) = 1) then //ctrl key
//do something

if ((GetAsyncKeyState($+164) and 1) = 1) then //alt key
//do something

if ((GetAsyncKeyState($+46) and 1) = 1) then //del key
//do something

OR

If you simple do not want task manager to run then you could close the window by putting this inside a timer:

postmessage(findwindow(nil,pchar('Windows Task Manager')),wm_close,0,0);

NOTE: this method is not perminate, it will only work while you have the program running

Regards,

Hypoviax
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12165277
Sorry, with the hook example remove those plus signs. I think the second method is better though
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12190301
I don't think that hook method will work or else MS would have a real serious problem. CTRL+ALT+DEL is captured before the messaging system sends it's as key messages.
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12195162
Hmmmm, it might be so Workshop_Alex. You will have to try it out.

Regards,

Hypoviax
0
 
LVL 3

Expert Comment

by:gandalf_the_white
ID: 12197513
jimy7s  i think you should tell us why you need it
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

by:Hypoviax
ID: 12197530
I agree, if we know what the purpose is then a more detailed answer may be posted!

Regards,

Hypoviax
0
 

Author Comment

by:jimy7s
ID: 12197775
hi guys . ok if i need to lockup my PC means nobody can access it so the only way to access it by ending the task ( program lock) via Task Manager so if it disabled i can forbid anyone to use my PC .
and thanks alot .
0
 

Author Comment

by:jimy7s
ID: 12197804
guys if the function works on most windows versions its be good.
0
 
LVL 3

Expert Comment

by:gandalf_the_white
ID: 12197860
what operating systems do you have on your computer?

because on xp an 2000 it would be enough to lock your pc
so no coding is necessary for reaching your goal
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12198175
Simply terminating task manager by closing the window would work. See my second suggestion

Regards,

Hypoviax
0
 

Author Comment

by:jimy7s
ID: 12200823
i wanna disable it silently .OK i mean that when any one pressed alt+ctrl+del it seems it has no effect ( no messages or even flash on the screen ) i hope you got my idea.
and i know the how to lock by using windows but i want to write my own program.
0
 
LVL 3

Expert Comment

by:CmdrRickHunter
ID: 12204230
here's the problem with that.  Windows is SPECIFICALLY coded against allowing you to do that.  Other than the gina.dll trick sugested earlier, windows DOES NOT allow you to trap/ignore/use/deny/etc alt-ctrl-del.  This is a security measure, to keep people from writing programs to steal logins.  If you want windows locked, you tell windows to lock itself, or you use the gina dll stuff, write your own lock in there, tell windows to use your lock, then tell windows to lock itself.
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12204377
If you have a timer at a interval of 1 ms and consistently close that window inside the ontimer event:

postmessage(findwindow(nil,pchar('Windows Task Manager')),wm_close,0,0);

...then it will close that window as soon as it opens - it is unlikely that there will be even a flash.

Regards,

Hypoviax
0
 
LVL 3

Expert Comment

by:gandalf_the_white
ID: 12214853
@hypoviax: the timer solution will work only in xp, because there the taskmanager is opened directly.

in win2k the whole screen changes, all hooks are deactivated and you have the screen with
the six options (log off, change password, turn off computer, task manager, ...)  (sorry for the translation - german windows)

without changing gina i know only one way. you can set the screensaverunning variable. but this
will deactivate all other windows specific key combinations (like the windows key, alt tab,  ...)

deactivate the keys:  
  systemparametersinfo(spi_screensaverrunning,1,@dummy,0);

activate the keys:
  systemparametersinfo(spi_screensaverrunning,0,@dummy,0);


btw changing gina will result in problems if you want to use updates from microsoft,
as i dont think the installer will run on modified systems (at least i would not allow it)

regards
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 12221746
Actually, gandalf_the_white  my solution will work in Win2k because as soon as the user selects windows taskmanager the window will close immediately. I have tried this and it works. Of course it is not as good as the effect in WinXp but it works just the same. Similarly if the author wants to apply the restrictions on say Change Password (Not present on all computers) then the window title for the change password window could thus be added to the timer - the window will close without the user knowing and they will assume that they cannot change the password. As for the log off and shutdown, these features are present under the start menu anyway and can be restricted more easily in the registry

Best Regards,

Hypoviax
0
 
LVL 3

Expert Comment

by:gandalf_the_white
ID: 12224059
>> i wanna disable it silently .OK i mean that when any one pressed alt+ctrl+del it seems it has no effect ( no messages or even flash on the screen ) i hope you got my idea.
>> and i know the how to lock by using windows but i want to write my own program.

disable silently won't work in win2k as long as the windows specific keys are allowed
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now