Link to home
Start Free TrialLog in
Avatar of jimy7s
jimy7s

asked on

disable ALT + CTRL + DEL

how can i disable ALT + CTRL + DEL programmeticly .
Avatar of CmdrRickHunter
CmdrRickHunter

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
Avatar of Wim ten Brink
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...
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;
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
ASKER CERTIFIED SOLUTION
Avatar of Hypoviax
Hypoviax
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, with the hook example remove those plus signs. I think the second method is better though
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.
Hmmmm, it might be so Workshop_Alex. You will have to try it out.

Regards,

Hypoviax
jimy7s  i think you should tell us why you need it
I agree, if we know what the purpose is then a more detailed answer may be posted!

Regards,

Hypoviax
Avatar of jimy7s

ASKER

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 .
Avatar of jimy7s

ASKER

guys if the function works on most windows versions its be good.
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
Simply terminating task manager by closing the window would work. See my second suggestion

Regards,

Hypoviax
Avatar of jimy7s

ASKER

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.
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.
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
@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
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
>> 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