Library code snippets

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

Comments

  1. 19 Mar 2005 at 14:17
    try this out
    KeyboardControl SDK
  2. 13 Mar 2005 at 17:04

    can someone help me how to disable Ctrl-Alt-Del, alt-tab and Window key on windows xp visual basic program...

  3. 06 Dec 2003 at 01:22
    can it use for winxp??
  4. 18 Sep 2003 at 03:30

    Thanks for the input HyperHacker...it's given me some new things to investigate. Thank You.  

  5. 15 Sep 2003 at 23:06

    Depends what your app is doing. In WinXP I've found that with a fullscreen always-on-top app, if Task Manager is already running in the tray (which can be done by running it with the vbhide parameter in VB) it won't show up. But if your app's not fullscreen you should probably go for the more guaranteed but very unprofessional-looking approach: Use a loop/timer to close it via SendMessage, sending the message WM_CLOSE to any window named "Windows Task Manager". (Of course then they could just hax0r the title of it in the EXE...)


    Of course you could just temporarily replace taskmgr.exe. And as for disabling Alt+Tab, oh how I wish I knew.

  6. 15 Sep 2003 at 17:41

    Any idea how to do this for all other windows platforms other than 95 & 98

  7. 27 Jan 2003 at 12:27
  8. 01 Aug 2002 at 18:48

    Hello Guys, Could someone tell me how to lock a keyboard through VisualBasic ? C++ would also be ok but easier in VB. Thanks


    Patrick

  9. 01 Jan 1999 at 00:00

    This thread is for discussions of How to disable Ctrl+Alt+Del.

Leave a comment

Sign in or Join us (it's free).

 Abdul
AddThis

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

Want to stay in touch with what's going on? Follow us on twitter!