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

Comments

 Abdul

Contribute

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.

“Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why.”