[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2561
  • Last Modified:

Block Ctrl+alt+del

Hi,

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

ctrl+alt+del
alt+tab
ctrl+esc
windows button

But alt+f4 should be enabled.

Iam Programming in VB 6
Plz help me

Thanks
Regards
Javid
0
javidmasti
Asked:
javidmasti
1 Solution
 
Marv-inCommented:
this is a good example of how to hook the keyboard and stop any key combo you want:
http://blackbeltvb.com/free/KEYHOOK.ZIP

also searching google for 'visual basic keyboard hook' will have more examples
0
 
Mikal613Commented:
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          

Code

  Sub DisableCtrlAltDelete(bDisabled As Boolean)
     Dim X As Long
     X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
  End Sub
0
 
Mikal613Commented:
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.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Marv-inCommented:
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 =[
http://www.meliorasoft.com/kits/keyboard/
0
 
Mikal613Commented:
if you dont mind spending money

There are good ones out there
0
 
frankdCommented:
Try this site:

http://www.phord.com/keyblock.html

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

Frank
0
 
gecko_au2003Commented:
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.
0
 
jagadeesh_motamarriCommented:
Hello,
    with this code u can block any where.....

the link:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1494&lngWId=1

---------------------------------------------------------------------------------

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 Const SPI_SCREENSAVERRUNNING = 97


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
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     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.
'
'Assumes:None
'
'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
' Code.com) '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
    Disable_Ctrl_Alt_Del
    MsgBox "CTRL+ALT+DEL is disabled, try pressing CTRL+ALT+DEL now.", , "Disable/Enable CTRL+ALT+DEL"
    Again:
    X = MsgBox("Enbale CTRL+ALT+DEL now?", 36, "Disable/Enable CTRL+ALT+DEL")


    If X = vbYes Then
        Enable_Ctrl_Alt_Del
    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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now