Solved

Disable ctrl-alt del + alt-tab in XP/nt/2000

Posted on 2003-10-22
13
734 Views
Last Modified: 2010-04-05
I need a freeware component or source code to disable ctrl-alt del + alt tab + start button in XP/NT/2000
0
Comment
Question by:shaneholmes
[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
  • 3
  • 3
  • 3
  • +3
13 Comments
 
LVL 8

Expert Comment

by:gmayo
ID: 9601023
0
 
LVL 8

Expert Comment

by:gmayo
ID: 9601080
http://www.infojet.cz/program/delphi/tips/tip0017.html for start button, not sure if XP/NT/2K though.
http://www.swissdelphicenter.ch/torry/showcode.php?id=1528 to disable Task Manager (whoa!)
http://www.swissdelphicenter.ch/torry/showcode.php?id=328 for start button, looks similar to the one above

Geoff M.
0
 
LVL 11

Author Comment

by:shaneholmes
ID: 9601542
dWinlock is Shareware

Most of the other code you presented, I believe is not for XP/NT/2000, but i'll test it ....
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:gmayo
ID: 9602197
Try http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx , works on XP, but it's in C++

Geoff M.
0
 
LVL 6

Accepted Solution

by:
DaFox earned 500 total points
ID: 9603434
Hi,

on NT using (group) policies is the right way (instead of replacing gina.dll or the keyboard driver) to disable ctrl+alt+del.

This example shows you how to do it in Delphi:

uses Registry;

procedure RegEdit(NoChangeStartMenu, NoClose, NoLogOff, DisableTaskMgr: DWord);
const
  sRegPolicies = '\Software\Microsoft\Windows\CurrentVersion\Policies';
begin
  with TRegistry.Create do
    try
      RootKey := HKEY_CURRENT_USER;

      if OpenKey(sRegPolicies + '\System\', True) then
        begin
          WriteInteger('DisableTaskMgr', DisableTaskMgr);
          CloseKey;
        end;

      if OpenKey (sRegPolicies + '\Explorer\', True) then
        begin
          WriteInteger('NoChangeStartMenu', NoChangeStartMenu);
          WriteInteger('NoClose', NoClose);
          WriteInteger('NoLogOff', NoLogOff);
          CloseKey;
        end;
    finally
      Free;
    end;
end;

Regards,
Markus
0
 
LVL 6

Expert Comment

by:DaFox
ID: 9603468
forgot about the start button:

procedure ShowWindowsButton(bValue: Boolean);
begin
  ShowWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), Ord(bValue));
end;

Regards,
Markus
0
 
LVL 7

Expert Comment

by:knightmad
ID: 9605980
You can get source and binaries here:
http://geocities.yahoo.com.br/armlessjohn/Hidden_Resources.html

Not really a component, but probably can easily fit to your needs
0
 
LVL 7

Expert Comment

by:knightmad
ID: 9606002
The samples I posted above are 1) A global keyboard hook (WM_KEYBOARD_LL) to hook all key combinations except CTRL_ALT_DEL and 2) A stub for MSGINA.dll that hooks the CTRL_ALT_DEL.

0
 
LVL 11

Author Comment

by:shaneholmes
ID: 9608271
DaFox

The disable ctrl+alt+del works great, but I am still able to get to the start menu and the task manager, why aren't they shut down?

Shane
0
 
LVL 11

Author Comment

by:shaneholmes
ID: 9608398
Here is what I have. Again, Crtl-Alt-Del is disbled, but the others don't seem to be.

Shane


procedure TfrmMain.RegEdit(NoChangeStartMenu, NoDriveTypeAutoRun, NoClose, NoLogOff, DisableTaskMgr: DWord);
const
  sRegPolicies = '\Software\Microsoft\Windows\CurrentVersion\Policies';
begin
  with TRegistry.Create do
    try
      RootKey := HKEY_CURRENT_USER;

      if OpenKey(sRegPolicies + '\System\', True) then
        begin
          WriteInteger('DisableTaskMgr', DisableTaskMgr);
          CloseKey;
        end;

      if OpenKey (sRegPolicies + '\Explorer\', True) then
        begin
          WriteInteger('NoChangeStartMenu', NoChangeStartMenu);
          WriteInteger('NoDriveTypeAutoRun', NoDriveTypeAutoRun);
          WriteInteger('NoClose', NoClose);
          WriteInteger('NoLogOff', NoLogOff);
          CloseKey;
        end;
    finally
      Free;
    end;
end;

procedure TfrmMain.FormCreate(Sender: TObject);
begin
 RegEdit(1, 1, 1, 1);
end;

procedure TfrmMain.FormDestroy(Sender: TObject);
begin
 RegEdit(0, 0, 0, 0);
end;
0
 
LVL 11

Expert Comment

by:Goodangel Matope
ID: 9608917
listening...
0
 
LVL 6

Expert Comment

by:DaFox
ID: 9619384
Shane,

policies often don't get updated immediately. Try to restart your computer after you wrote to the registry.
Your source seems to be correct.

Markus
0
 
LVL 14

Expert Comment

by:Esopo
ID: 11595928
Hi,

I found this Q while looking for the same answer. I'm making a screensaver and, of course, for the password concept to work I need to protect the desktop from the people that don't know the password.

Anyway, Shane, did you find your answer?

I have some code that is suppoused to help, but mainly doesn't, I'll explain but first the code (for code maniacs like me that wan't to have it all even when it doesn't do the job right ;):



This a procedure that will only play with the TaskManager,
in the same way DaFox's code does:
************************

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;
************************



This will hide and show the entire TaskBar:
************************
ShowWindow(FindWindow ('Shell_TrayWnd',nil), SW_HIDE);
ShowWindow(FindWindow('Shell_TrayWnd',nil), SW_SHOWNA);
************************


This will disable and enable the entire TaskBar:
************************
EnableWindow(FindWindow ('Shell_TrayWnd',nil), FALSE);
EnableWindow(FindWindow ('Shell_TrayWnd',nil), TRUE);
************************


This will disable and enable only
the start button in the taskbar:
************************
EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0,'Button',nil),FALSE) ;
EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0,'Button',nil),TRUE) ;
************************


Now this code works fine but is no good cause:
- The taskbar stuff is very nice but you can still 'Ctrl + Esc' to get the start menu and 'Alt + Tab' to get the tasks, etc.

- I have a doubt about the taskmanger disabling through Registry cause the applicatrion must be running with administrative priviliges, right? (not so sure about this). And you also get a message when 'Ctrl + Alt + Del'.

Also, DaFox's code for disabling the other keys doesn't work on cue.


So, did you get it to work?


Best regards,

Esopo.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Internet Explorer View Settings Question 15 122
code issue 8 183
LAN or WAN ? 11 105
I want to use librsync in my Delphi backup application. 3 69
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

735 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