Subscribe via email

Enter your email address:

Delivered by FeedBurner

Search Any Article In

Custom Search

Visual Basic Code of the Day, Disabling Ctrl+Alt+Del

Visual Basic Code of the Day, Disabling Ctrl+Alt+Del



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

Private Sub Form_Unload(Cancel As Integer)

' when this app closes, make sure CTRL+ALT+DELETE is re-enabled
Call Command2_Click

End Sub

Private Sub cmdDisableCTRLALTDEL_Click()

Dim Ret As Long
Dim pOld As Boolean
Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)

End Sub

Private Sub cmdEnableCTRLALTDEL_Click()

Dim Ret As Long
Dim pOld As Boolean
Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)

End Sub