Library code snippets
How to disable Ctrl+Alt+Del
By Abdul, published on 14 Jul 2001
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
Related articles
Related discussion
-
Automating Excel from VB6.0
by epurdy (0 replies)
-
VB6 system conversion using VBA to Word 2007
by b.macgregor@vodamail.co.za (0 replies)
-
video not working with visual basic
by Jupiter 2 (9 replies)
-
Hyperterminal Data
by sengreen (1 replies)
-
vb6 - custom font
by Ruffsta3 (0 replies)
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...
KeyboardControl SDK
can someone help me how to disable Ctrl-Alt-Del, alt-tab and Window key on windows xp visual basic program...
Thanks for the input HyperHacker...it's given me some new things to investigate. Thank You.
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.
Any idea how to do this for all other windows platforms other than 95 & 98
KeyboardControl SDK
Hello Guys, Could someone tell me how to lock a keyboard through VisualBasic ? C++ would also be ok but easier in VB. Thanks
Patrick
This thread is for discussions of How to disable Ctrl+Alt+Del.