怎样在windows2000中屏蔽ctrl+alt+del?,用VB实现

解决方案 »

  1.   

    Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As LongPrivate Const SPI_SCREENSAVERRUNNING = 97
    Private Sub Command1_Click()
        Dim ret As Integer
        Dim pOld As Boolean
                   
        If Command1.Caption = "屏蔽" Then   '使Ctrl+Alt+Del有效
            ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
            Command1.Caption = "有效"
        Else                                '使Ctrl+Alt+Del无效
            ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
            Command1.Caption = "屏蔽"
        End If
    End SubPrivate Sub Form_Load()
        Command1.Caption = "屏蔽"
    End SubPrivate Sub Form_Unload(Cancel As Integer)
        Dim ret As Integer
        Dim pOld As Boolean
            
        '退出前使ALT+CTL+DEL有效
        ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
    End Sub