1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| Private Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" _
(ByVal HKey As Long, _
ByVal lpSubKey As String, _
phkResult As Long) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" _
(ByVal HKey As Long, _
ByVal lpSubKey As String) As Long
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 cmdact_Click()
'Win 95/98
'Désactive/Active en informant Windows qu'il tourne en tant
'qu'écran de veille, ce qui desactive le ctrl alt suppr
Dim Retour As Long
Dim a As Boolean
Retour = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, a, 0)
'Win suivant
Dim Val As Long
RegCreateKey HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", Val
RegDeleteValue Val, ByVal "DisableTaskMgr"
End Sub
Private Sub cmddesact_Click()
'Win 95/98
'Désactive/Active en informant Windows qu'il tourne en tant
'qu'écran de veille, ce qui desactive le ctrl alt suppr
Dim Retour As Long
Dim a As Boolean
Retour = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, a, 0)
'Win suivant
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", "1"
End Sub
Private Sub Form_Unload(Cancel As Integer)
'De preference pour eviter les merdes :-)
Call cmdact_Click
End Sub |
Partager