Block Ctrl+alt+del


I have a requirnment in my application when ever my application runs either in windows 98 or windows 2000 these controls should be disabled.

windows button

But alt+f4 should be enabled.

Iam Programming in VB 6
Plz help me

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

this is a good example of how to hook the keyboard and stop any key combo you want:

also searching google for 'visual basic keyboard hook' will have more examples
This function should do it.

  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          


  Sub DisableCtrlAltDelete(bDisabled As Boolean)
     Dim X As Long
     X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
  End Sub
You CANNOT disable Ctrl-Alt-Del in any way shape or form on Windows NT. No matter how hard you try, this question has been asked many times here and elsewhere and there is NO solution to it that has yet been found.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

yes thats true, in nt ctrl+alt+del is a considered its onwn interrupt

this is the only thing out there that will intercept it - its not free =[
if you dont mind spending money

There are good ones out there
Try this site:

I've downloaded a demo and works in NT as well as 98/2000

Shane Russell2nd Line Desktop SupportCommented:
I am not sure about NT or Windows 98 but I know in windows xp there is a registry key to block the Task manager ( which is what you get after you press ctrl + alt + delete ). Not sure if that is what you wanted though.
    with this code u can block any where.....

the link:


The same code is copied here...


 This code disables/enabled CTRL+ALT+DEL pressing ' To disable CTRL+ALT+DEL, call the function Disable_CTRL_ALT_DEL ' To enabled CTRL+ALT+DEL, call the function Enable_CTRL_ALT_DEL

Windows API/Global Declarations:
'Windows API/Global Declarations for :Di
'     sable/Enable CTRL+ALT+DEL
'     ************************
'Windows API/Global Declarations for :Di
'     ssable / Enable CTRL + AL
' T + DEL
'     ************************

Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long

Public Sub Disable_Ctrl_Alt_Del()
    'Disables the Crtl+Alt+Del
    Dim AyW As Integer
    Dim TurFls As Boolean
    AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, TurFls, 0)
End Sub

Public Sub Enable_Ctrl_Alt_Del()
    'Enables the Crtl+Alt+Del
    Dim AwY As Integer
    Dim TurFls As Boolean
    AwY = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, TurFls, 0)
End Sub

' Name: Disable/Enable CTRL+ALT+DEL
' Description:' This code disables/enabl
'     ed CTRL+ALT+DEL pressing
' To disable CTRL+ALT+DEL, call the func
'     tion Disable_CTRL_ALT_DEL
' To enabled CTRL+ALT+DEL, call the func
'     tion Enable_CTRL_ALT_DEL
' By: King Patrik the Zerg
'This code is copyrighted and has' limited warranties.Please see http://w
'     wCode.asp?txtCodeId=1494&lngWId=1'for details.'**************************************

' Put this into Sub Main in a module
' Disable/Enable CTRL+ALT+DEL
'     ************************
' Name: Dissable / Enable CTRL + ALT + D
'     EL
' Description:Dissable / Enable CTRL + A
'     LT + DEL , This does just
' what it says, it disables a used from
'     pressing CTRL+ALT+DEL. Well
' not dissables them from doing it, it j
'     ust wont do anything if the
' y do. :o)This is useful in setup progr
'     ams when it is important th
' ea a user not end task your program.
' By: Cy Toad
' Inputs:'Example of use:
' Call Disable_Ctrl_Alt_Del()
'Then at another time:
' Call Enable_Ctrl_Alt_Del()
' Returns:Dissables / Enables CTRL + ALT
'     + DEL You wont be able t
' o use CTRL + ALT + DEL until you Enabl
'     e it again, or restart your
' system.
'Side Effects:You wont be able to use CT
'     RL + ALT + DEL until you
' Enable it again, or restart your syste
'     m.
'Code provided by Planet Source Code(tm)
'     (http://www.PlanetSource
' 'as is', without warranties
'     as to performance, fitness,
' merchantability,and any other warranty
'     (whether expressed or impl
' ied).
'     ************************
Dim X
X = MsgBox("Do you wish To disable CTRL+ALT+DEL?", 36, "Disable/Enable CTRL+ALT+DEL")

If X = vbYes Then
    MsgBox "CTRL+ALT+DEL is disabled, try pressing CTRL+ALT+DEL now.", , "Disable/Enable CTRL+ALT+DEL"
    X = MsgBox("Enbale CTRL+ALT+DEL now?", 36, "Disable/Enable CTRL+ALT+DEL")

    If X = vbYes Then
    ElseIf X = vbNo Then
        MsgBox "The program will Not End before CTRL+ALT+DEL is enabled.", , "Disable/Enable CTRL+ALT+DEL"
        Goto Again
    End If
End If

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.