VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



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

by Steve Berardi (3 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (37 Votes)

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.

Assumes
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

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

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

Download this snippet    Add to My Saved Code

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

No comments have been posted about Disable the effect of Ctrl+Alt+Del and Alt+Tab. Why not be the first to post a comment about Disable the effect of Ctrl+Alt+Del and Alt+Tab.

Post your comment

Subject:
Message:
0/1000 characters