shaneholmes
asked on
Disable ctrl-alt del + alt-tab in XP/nt/2000
I need a freeware component or source code to disable ctrl-alt del + alt tab + start button in XP/NT/2000
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.
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.
ASKER
dWinlock is Shareware
Most of the other code you presented, I believe is not for XP/NT/2000, but i'll test it ....
Most of the other code you presented, I believe is not for XP/NT/2000, but i'll test it ....
Try http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx , works on XP, but it's in C++
Geoff M.
Geoff M.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
forgot about the start button:
procedure ShowWindowsButton(bValue: Boolean);
begin
ShowWindow(FindWindowEx(Fi ndWindow(' Shell_Tray Wnd', nil), 0, 'Button', nil), Ord(bValue));
end;
Regards,
Markus
procedure ShowWindowsButton(bValue: Boolean);
begin
ShowWindow(FindWindowEx(Fi
end;
Regards,
Markus
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
http://geocities.yahoo.com.br/armlessjohn/Hidden_Resources.html
Not really a component, but probably can easily fit to your needs
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.
ASKER
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
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
ASKER
Here is what I have. Again, Crtl-Alt-Del is disbled, but the others don't seem to be.
Shane
procedure TfrmMain.RegEdit(NoChangeS tartMenu, NoDriveTypeAutoRun, NoClose, NoLogOff, DisableTaskMgr: DWord);
const
sRegPolicies = '\Software\Microsoft\Windo ws\Current Version\Po licies';
begin
with TRegistry.Create do
try
RootKey := HKEY_CURRENT_USER;
if OpenKey(sRegPolicies + '\System\', True) then
begin
WriteInteger('DisableTaskM gr', DisableTaskMgr);
CloseKey;
end;
if OpenKey (sRegPolicies + '\Explorer\', True) then
begin
WriteInteger('NoChangeStar tMenu', NoChangeStartMenu);
WriteInteger('NoDriveTypeA utoRun', 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(Sende r: TObject);
begin
RegEdit(0, 0, 0, 0);
end;
Shane
procedure TfrmMain.RegEdit(NoChangeS
const
sRegPolicies = '\Software\Microsoft\Windo
begin
with TRegistry.Create do
try
RootKey := HKEY_CURRENT_USER;
if OpenKey(sRegPolicies + '\System\', True) then
begin
WriteInteger('DisableTaskM
CloseKey;
end;
if OpenKey (sRegPolicies + '\Explorer\', True) then
begin
WriteInteger('NoChangeStar
WriteInteger('NoDriveTypeA
WriteInteger('NoClose', NoClose);
WriteInteger('NoLogOff', NoLogOff);
CloseKey;
end;
finally
Free;
end;
end;
procedure TfrmMain.FormCreate(Sender
begin
RegEdit(1, 1, 1, 1);
end;
procedure TfrmMain.FormDestroy(Sende
begin
RegEdit(0, 0, 0, 0);
end;
listening...
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
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
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('CurrentVersio n', True);
reg.OpenKey('Policies', True);
reg.OpenKey('System', True);
if bTF = True then
begin
reg.WriteString('DisableTa skMgr', '1');
end
else if bTF = False then
begin
reg.DeleteValue('DisableTa skMgr');
end;
reg.CloseKey;
end;
************************
This will hide and show the entire TaskBar:
************************
ShowWindow(FindWindow ('Shell_TrayWnd',nil), SW_HIDE);
ShowWindow(FindWindow('She ll_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_Tr ayWnd', nil), 0,'Button',nil),FALSE) ;
EnableWindow(FindWindowEx( FindWindow ('Shell_Tr ayWnd', 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.
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('CurrentVersio
reg.OpenKey('Policies', True);
reg.OpenKey('System', True);
if bTF = True then
begin
reg.WriteString('DisableTa
end
else if bTF = False then
begin
reg.DeleteValue('DisableTa
end;
reg.CloseKey;
end;
************************
This will hide and show the entire TaskBar:
************************
ShowWindow(FindWindow ('Shell_TrayWnd',nil), SW_HIDE);
ShowWindow(FindWindow('She
************************
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(
EnableWindow(FindWindowEx(
************************
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.
http://delphi.about.com/library/weekly/aa022701a.htm (see Part 2 as well)
Geoff M.