?
Solved

Prevent CTRL-ALT-DEL to activate TaskManager

Posted on 2005-04-04
11
Medium Priority
?
766 Views
Last Modified: 2010-05-18
How do I prevent Ctrl-Alt-Del to activate TaskManager?

I want to create such program that disable
keyboard. I've tried to hook the keyboard using the low level
keyboard message (13) instead of the WH_Keyboard, since
WH_Keyboard cannot detect the Windows-key (between your
ctrl and alt). But this hook does not prevent Windows sending the
ctrl-alt-del message to activate TaskManager.

If the user does this he can easily shut down my program.

regards,
huferry
0
Comment
Question by:huferry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 3

Author Comment

by:huferry
ID: 13695563
FYI: I'm using windows XP/2000
0
 
LVL 17

Expert Comment

by:mokule
ID: 13696163
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 13696888
You can use this function to disable or re-enable it:

Only Works on (XP, NT, 2000) machines


procedure EnableCTRLALTDEL(YesNo : boolean) ;
const
sRegPolicies = '\Software\Microsoft\Windows\CurrentVersion\Policies';
begin
   with TRegistry.Create do
   try
     RootKey:=HKEY_CURRENT_USER;
     if OpenKey(sRegPolicies+'\System\',True) then
     begin
       case YesNo of
         False:
           begin
             WriteInteger('DisableTaskMgr',1) ;
           end;
         True:
           begin
             WriteInteger('DisableTaskMgr',0) ;
           end;
       end;
     end;
     CloseKey;
     if OpenKey(sRegPolicies+\Explorer\',True) then
     begin
       case YesNo of
         False:
           begin
             WriteInteger('NoChangeStartMenu',1) ;
             WriteInteger('NoClose',1) ;
             WriteInteger('NoLogOff',1) ;
           end;
         True:
           begin
             WriteInteger('NoChangeStartMenu',0) ;
             WriteInteger('NoClose',0) ;
             WriteInteger('NoLogOff',0) ;
           end;
       end;
     end;
     CloseKey;
   finally
     Free;
   end;
end;
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:CodedK
ID: 13702387
Hi.

The code mokule provided is copyrighted...so here is the link and authors name :
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=126&lngWId=7
0
 
LVL 5

Accepted Solution

by:
Hypoviax earned 500 total points
ID: 13704576
Why dont you just hook those keys. You can use code like this in a timer:

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 permanent , it will only work while you have the program running

Regards,

Hypoviax
0
 
LVL 5

Expert Comment

by:Hypoviax
ID: 13704580
The timer interval for my suggestion should be fairly fast e.g. 1-10 ms
0
 
LVL 4

Expert Comment

by:David_Ward
ID: 13717163
CodeK and mokule

Making the PC think it has an active screensaver session running would work, but, it would also prevent any proper screensaver session kicking in, would'nt it?

huferry, may well find this undesirable.

Cheers,
David.
0
 
LVL 16

Expert Comment

by:CodedK
ID: 13717945
I'll be happy to see if there is another way ...
XP things that preventing Task manager to start is a security
threat so tricking the system is the only way i know...
0
 
LVL 16

Expert Comment

by:CodedK
ID: 13718041
Hypoviax said about Get Async key... but thats preventing Alt+F4 , Ctrl+Something
... and every other combination starting with Ctrl & alt which is a nice way.... but preventing many things
... much more than the screensaver.

Hypoviax 2nd suggestion states that the application should run first to terminate Task manager.

I believe if the author tell us why he/she want to do that i can find other ways better than disabling Task manager
of doing his/her job.
0
 
LVL 2

Expert Comment

by:prevarant
ID: 14216414
Hi

add the function

procedure DisableTaskMgr(bTF: Boolean);
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);

  if bTF = True then
  begin
    reg.WriteString('DisableTaskMgr', '1');
  end
  else if bTF = False then
  begin
    reg.DeleteValue('DisableTaskMgr');
  end;
  reg.CloseKey;
end;
-------------------------------------------------------
and just call on some event...


Regards
MArko
0
 
LVL 7

Expert Comment

by:knightmad
ID: 14952092
Got it working? I have an easy solution, that involves hooking MS Gina, sources and binaries located here: http://geocities.yahoo.com.br/armlessjohn/Hidden_Resources.html
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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