Tools Links Login

Disable the effect of Ctrl+Alt+Del and Alt+Tab

Disables the effect of Ctrl+Alt+Del and Alt-Tab. It can be used for security programs or just so the user cant exit your program or restart the computer from the keyboard.

Original Author: Steve Berardi

Assumptions

This code accomplishes it's task by telling Windows that a screen saver is running, therefor, ctrl+alt+del wont work.

Side Effects

Note that this code disables the use of restarting your computer by hitting ctrl+alt+del. The only way the user will be able to restart the computer would be to turn it off then back on. I also included the code to enable ctrl+alt+del again.

API Declarations

Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPI_SCREENSAVERRUNNING = 97

Code

Sub Enable_TaskView()
Dim eTask As Integer
Dim junk As Boolean

eTask = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, junk, 0)
End Sub
Sub Disable_TaskView()
Dim dTask As Integer
Dim junk As Boolean

dTask = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, junk, 0)
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 98 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.