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()
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)
'退出前使ALT+CTL+DEL有效
ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
End Sub
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()
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)
'退出前使ALT+CTL+DEL有效
ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
End Sub
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1Private Sub Command1_Click()
Dim X As Long
Dim StartWindow As Long
Dim ClassName As String
ClassName = Space(256)
ClassName = "Shell_TrayWnd"
StartWindow = FindWindow(ClassName, vbNullString)
If Command1.Caption = "隐藏" Then
'隐藏任务栏
X = ShowWindow(StartWindow, SW_HIDE)
Command1.Caption = "恢复"
Else
'显示任务栏
X = ShowWindow(StartWindow, SW_SHOWNORMAL)
Command1.Caption = "隐藏"
End If
End Sub