Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I disable the Ctrl+Alt+Del combination?

Status
Not open for further replies.

PankajAgr

Technical User
Jul 30, 2003
52
0
0
IN
Hi Guys,

I want to know how to disable the Ctrl+Alt+Key combination in Win-2000 & Win-NT OS.

Thanks in Advance

Pankaj
 
Without going into the details, I'll summarise with a "you can't."

If you want details, just do a keyword search in this forum.
 
I have not tried this. You can find it at:



Declarations:

Option Explicit

Private Declare Function SystemParametersInfo Lib _
"user32" Alias "SystemParametersInfoA" (ByVal uAction _
As Long, ByVal uParam As Long, ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long

Private Const SPI_SETSCREENSAVERRUNNING = 97

Code:

Public Sub DisableCAD(Disabled As Boolean)

'SET DISABLED TO TRUE TO DISABLE CTRL-ALT-DELETE
'SET DISABLED TO FALSE TO RE-ENABLE

Dim lRet As Long
lRet = SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, _
Disabled, 0&, 0&)
End Sub

I saw some other links where you can modifiy the registry also. A Google serach on "visual basic disable the Ctrl+Alt+Key" has more info.
 
personally I can't think of any valid reason why you would want to disable this in a VB application.

If you set the user-permissions right, everything should be more or less safe and if you disable CTRL+ALT+DELETE you (as an admin) too loose a very valuable tool in system management.
 
Most people who want to disable this are running in a kiosk environment, where the general public can walk up and use the PC. Like has been covered (many times before - do a search), it's possible to trap C-A-D in a Win9x environment, but it's not really feasible in a WinNT/2k/XP environment.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
chiph,
Have you checked the links I posted that give examples of how to do exactly what you say can't be done? I agree with Overdoos that it is not very practical and it is dangerous but it is possible and I gave only 2 links that give examples and step by step instrictions. There are more and it does work but I don't know how practical the solutions are let alone the result.

pankaj,
Are you trying to prevent the machine from being rebooted? A simple push of the reset or poweroff/on will overide that provide there is physical access to the PC "box". Are you wanting to prevent your app from showing in the ctrl-alt-delete? Just might want to think of the ultimate goal and see if there is a better alternative or if the solution is better or worse then the problem.
 
> have not tried this. You can find it at:

Only good for W9x/Me

 
The links I provided are for NT/2000. I have not tested them but they are said to work and a reliable source has told me that they have tested it and it works. Again, I strongly advise against it but the answer to the question is still YES you can do this.
 
I would really not use any undocumented properties of registry values. They have the habit of breaking once MS releases service packs to close the holes.

The documented method is to use C/C++ to write a GINA dll, which hooks into the secure attention sequence call chain. It's not for the faint of heart.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Firstly, as chiph points out, using undocumented registry settings is likely to lead to tears.

Secondly solutions you point to do the following, I believe:
1) Disables the C-A-D prompt (not CAD itself, just the prompt)
2) Jump right to the login screen (however, since we've enabled autologin we never see the login prompt)

In other words, it only looks like CAD has been disabled (for some purposes this may be enough, I'll grant)

However it doesn't actually disable CAD and, at the same time, opens up a major security breach.

> I have not tested them but they are said to work

I like this idea of posting solutions that other people have said work without ever having to test them...
 
Ok, I said that it is possible to do and I gave links to sample code and info on how to do this as well as comments (Planet Source Code link) on alternatives that may get Pankaj looking in the right direction for his/her specific needs. Granted this question needs clarification so we know better how to help. I submit the following question to Pankjab for clarification...
1. Do you want to prevent the user from seeing your app in the Task Manager thereby preventing them from "killing" it?
2. Do you want to prevent the Task Manager from comming up at all by using CAD or by any means including CAD?
3. Bottom line it for us. What is the ultimate goal you seek.

Now the answers to the above questions asside I agree I should not have said that it will work so knowingly without having tried them myself but as we who visit this site and take and give info so frequently do I have relied on the experience of a fellow collegue whom I respect. We made some assumptions that the idea was to prevent the Task Manager form appearing by pressing Ctrl-Alt-Delete and the code/info at the links I provided does do just that and more importantly it gives them something to think about as to exactly what they want to do.

Again, as I stated above I do not think this is a good idea to do nor is it "clean" but to say it can't be done because it shouldn't be done does not help. There are good legitimate reasons for wanting to do what Pankjab is asking and there are ways to do it. I merely meant to provide Pankjab with some resources for possible solutions to his problem not to indicate it was a complete, recommended or stable solution.
 
I am sorry pankaj that I misspelled your name in the above post. It was truly unintentional. And to the rest of you I am not trying to come off in a combative way so plz to not take it that way. Just trying to be constuctive is all.
 
I have to wonder why you would do this.... better and easier to provide a keyboard without the Ctrl and Alt keys if you are writing a kiosk system. We did this with a system we put one location where the user still needed a keyboard.

Other combos you would have to stop
Ctrl Shift Esc
Windows key and many different keys


Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
Hi bmdb,

Sorry I couldn't reply u on time.

Thanks, u gave me a link of so many good web sides & I found the alternative solutions for my problem in these website.

My understanding is we cannot block the C-A-D but we can disable the task Manager & other corresponding buttons.

Actually my requirement is I want to design top-level form, after booting the system this form will display & ask for the user name & password. When user enter valid name & password after that he can work on the system otherwise it restrict the user. So when my form will display during these time I want disable C-A-T & ALT+Tab combination.

Thanks for solve my query.

Pankaj

Senior Software Engineer,
Infotech Enterprises Limited
Hyderabad, Andhra Pradesh, India.
URL :
 
Actually my requirement is I want to design top-level form, after booting the system this form will display & ask for the user name & password. When user enter valid name & password after that he can work on the system otherwise it restrict the user. So when my form will display during these time I want disable C-A-T & ALT+Tab combination.
[\quote]

It seems to me you are trying to re-write the Windows GINA without realising it. Why go to all the trouble when MS have provided a (relatively) secure and tested mechanism for this.

Why not create either a domian wide or local security group and check whether the logged on user is a memeber of that group. You can allow/deny access to your system on that basis

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top