Results 1 to 5 of 5

Thread: this code doesn't work or either it's in the wrong order.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    Unhappy this code doesn't work or either it's in the wrong order.

    I put this code in my for to disable ctrl alt del
    I put this in the declorations part of my app
    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

    I put this in the form

    Sub DisableCtrlAltDelete(bDisabled As Boolean)
    Dim X As Long
    X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
    End Sub

    Call DisableCtrlAltDelete(True)

    but it doesn't disable ctrl alt delete and ctrl esc and I got the code from the site section.

    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Red face

    This code should work


    Code:
    'Windows API/Global Declarations 
    
    Public TaskBarhWnd As Long
    Public IsTaskBarEnabled As Integer
    Public TaskBarMenuHwnd As Integer
    
    
    'This goes in a Module
    
    Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
    
    
    Declare Function IsWindowEnabled Lib "user32" (ByVal hwnd As Long) As Long
    
    
    Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
    
    
    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    
    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
    
    '***********************************************************
    
    'Make 2 command buttons
    
    Sub FastTaskSwitching(bEnabled As Boolean)
        Dim X As Long, bDisabled As Long
        bDisabled = Not bEnabled
        X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
    End Sub
    
    
    Public Sub DisableTaskBar()
        Dim EWindow As Integer
        TaskBarhWnd = FindWindow("Shell_traywnd", "")
    
    
        If TaskBarhWnd <> 0 Then
            EWindow = IsWindowEnabled(TaskBarhWnd)
    
    
            If EWindow = 1 Then
                IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 0)
            End If
        End If
    End Sub
    
    
    Public Sub EnableTaskBar()
    
    
        If IsTaskBarEnabled = 0 Then
            IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 1)
        End If
    End Sub
    
    
    Private Sub Command1_Click()
        DisableTaskBar
        FastTaskSwitching False
    End Sub
    
    
    Private Sub Command2_Click()
        EnableTaskBar
        FastTaskSwitching True
    End Sub

    -Lumin

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    Question I really suck

    ok i'm so despret i'm willing to send my form to someone to place in a ctrl alt del and ctrl esc disable code into it then have them send it back. If your willing to (and want to or be nice enough to) please send me your e-mail address and i'll send you the form.
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  4. #4
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Cool

    I'll give it a try

    my e-mail is.

    [email protected]


    -Lumin

  5. #5
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Talking Done

    check your e-mail


    -Lumin

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