Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello everyone,

I'm presently working on a project that requires that the CTRL+ALT+DEL key is disabled. Can anyone please give me a clue on how to solve this problem in VB.NET? I'll appreciate any solution that will work with Windows XP, Vista and Window 7.

Thanks!
Posted
Updated 25-Jun-11 15:32pm
v2

To add more to the answer by Walt: it is certainly impossible. When you intercept any keyboard events, they are dispatched to your application window or system hook everything similar but not Ctrl+Alt+Del. This is how system work, for obvious reasons.

Now, what to do?
You need kiosk mode. Read about it here:
Running a Web Site in Kiosk Mode with C#[^],
c# program ctrl-alt-del screen windows 7[^].

—SA
 
Share this answer
 
v2
Comments
thatraja 25-Jun-11 23:49pm    
Yep, possibly he need kiosk. 5!
Sergey Alexandrovich Kryukov 26-Jun-11 0:00am    
Thank you, Raja.
--SA
CTRL+ALT+DEL is a low level Windows function, so I don't know of any good way to disable it, other than replacing part of the Windows system.

Why do you need to change the way Windows works?
 
Share this answer
 
Comments
SamFad 25-Jun-11 21:23pm    
I'm working on an application that run automatically when students logon to the system. Students are allocated time on the system and once their session expires, the system block them from using the system until they renew their session. But the challenge is that some students do use the taskmanger to disable the application once they have logged onto the system.
Dr.Walt Fair, PE 25-Jun-11 21:33pm    
It sounds like you need to disable Task Manager, not all Ctl+Alt+Del functionality. It is commonly disabled in the networked systems I use at The University.
SamFad 25-Jun-11 21:36pm    
Something like that. Please can you kindly give me a clue on how to go about it?
Simon_Whale 26-Jun-11 18:44pm    
Disabling Windows task manager is normally done by group policy.
Sergey Alexandrovich Kryukov 25-Jun-11 22:30pm    
My 4. What OP needs is kiosk mode.
Please see my answer.
--SA
You cannot disable Ctrl-Alt-Del from your application code, not even with a low-level keyboard hook. The reason is because C-A-D is part of Windows security system, NOT part of any user-mode application.

There are ways of doing it, but, like Walt said, you have to replace certain Windows libraries to do it. This is not something any user-mode code is going to be able to do.

No, I'm going to tell you how to do it because there is never a good reason to disable the key combination.
 
Share this answer
 
As walt said CTRL+ALT+DEL is a low level Windows function.....the only possible way is the uses of Global Hooks And Libraries.....Example

Lock Windows Desktop[^]
 
Share this answer
 
v2
Comments
SamFad 26-Jun-11 7:08am    
Thanks. It works using VB6 but I want the implementation on VB.Net and I will be grateful if u can bail me out
Rocky_Bas 3-Oct-12 2:07am    
How to do the same thing to disable delete key
Thanks everyone 4 your contribution 'cos they set me thinking. I have found a way around it and that is setting the 'DisableTaskmgr' value to true in the Registry.
Here is how I was able to accomplish that:

To disable Taskmanager:

VB
Private Sub DisableTaskManager()
    Dim regkey As RegistryKey
    Dim keyValueInt As String = "1"
    Dim subKey As String = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
    Try
        regkey = Registry.CurrentUser.CreateSubKey(subKey)
        regkey.SetValue("DisableTaskMgr", keyValueInt)
        regkey.Close()
    Catch ex As Exception
        MsgBox(ex.Message, MsgBoxStyle.Critical, "Registry Error!")
    End Try

End Sub



To Enable TaskManager
VB
Private Sub EnableTaskManager()
    Dim regkey As RegistryKey
    Dim keyValueInt As String = "0"    '0x00000000 (0)
    Dim subKey As String = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
    Try
        regkey = Registry.CurrentUser.CreateSubKey(subKey)
        regkey.SetValue("DisableTaskMgr", keyValueInt)
        regkey.Close()
    Catch ex As Exception
        MsgBox(ex.Message, MsgBoxStyle.Critical, "Registry Error!")
    End Try

End Sub



Thanks and I hope everyone will find this code snippet useful.
 
Share this answer
 
v2
Comments
Member 10042196 13-Aug-13 5:59am    
How about killing taskmanager process?
No need to mess up with API and registry.
:)
osamaworx 25-Jan-14 9:44am    
Kindly I face tha same problem , do you have C# Script for it ?
Mahendra Saini 28-Jul-14 3:47am    
access deniend error ouccer when use the following code
Private Sub DisableTaskManager()
Dim regkey As RegistryKey
Dim keyValueInt As String = "1"
Dim subKey As String = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
Try
regkey = Registry.CurrentUser.CreateSubKey(subKey)
regkey.SetValue("DisableTaskMgr", keyValueInt)
regkey.Close()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Registry Error!")
End Try

End Sub
Member 11868443 4-Aug-15 7:55am    
not working ridiculous code............

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900