Results 1 to 6 of 6

Thread: Trap Ctrl+Alt+Del

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Posts
    18

    Thumbs up

    How do you trap Ctrl+Alt+Del in windows 95, just like we did in old Dos.
    I want to prevent the task manager screen from coming up, on pressing the three keys, while my form is on the screen.

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226
    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
    
    Sub DisableCtrlAltDelete(bDisabled As Boolean)
        Dim X As Long
        X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
    End Sub
    To disable Ctrl-Alt-Delete:
    Call DisableCtrlAltDelete(True)

    To enable Ctrl-Alt-Delete:
    Call DisableCtrlAltDelete(False)

    Good luck.


  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Posts
    18

    Arrow I hope the code supplied works with your computer?

    have you tried the code yourself?

  4. #4
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226
    Sorry for being late.

    Yes I have. This is the way I use it.
    Paste the above code in a module.
    Paste these 2 calls in your form.

    Code:
    Private Sub Form_Load()
     Call DisableCtrlAltDelete(True)   ''' To Disable Ctrl+Alt+Del  System wide
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    Call DisableCtrlAltDelete(False)   ''' To Enable Ctrl+Alt+Del again
    End Sub

    Also, If you want To Disable Alt+F4 :
    Paste the following in your form.

    Code:
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
     Dim AltDown
     AltDown = (Shift And vbAltMask) > 0      'To Disable Alt+F4
      If KeyCode = vbKeyF4 And AltDown Then
         KeyCode = 0
         MsgBox " Sorry!    To exit this App. please press Quit Button"
      End If
    End Sub
    Good Luck.

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    I can verify, the code works.
    I was going to paste my method and saw the above and thought that there must be something missing as it was a callor two shorter than what I had been using.
    So, I tested it, and it worked like a charm....matter of fact I updated my code with Lyla's code because it was more slick and still got the job done.

    Wayne
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    New Member
    Join Date
    Nov 2000
    Posts
    2

    ctrl-alt-del win Nt/2000

    Does anybody know how to do it in nt or win2000. The above coed dosent work for me.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width