How to disable Ctrl+Alt+Del

How to disable/enable

This simple code shows you how to disable/enable the "ctrl, alt, del" keys so the user cannot quite the program which is currently running..

I have created a sub. Use the true statement if you want to disable the keys like thia:

a = disablekeys (true)

use the false statement if you want to enable the keys like this:

a = disablekeys (false)

Place two commandbuttons on the form and name them "enablek", disablek"
Now add the following code:

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 Sub disablekeys(disable As Boolean)
SystemParametersInfo 97, disable, CStr(1), 0
End Sub

Private Sub disablek_Click()
disablekeys True
End Sub

Private Sub enablek_Click()
disablekeys False
End Sub

You might also like...




Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” - Dennis Ritchie