GOD_Father 2004-6-21 16:55
不做钩子就屏蔽AIT+CTRL+DEL
有三种方法
希望大家帮助测试:
第一段:
'屏蔽Ctrl+Alt+Del:
Option Explicit
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0
Private Sub MakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
RegisterServiceProcess pid, RSP_SIMPLE_SERVICE
End Sub
Private Sub UnMakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
RegisterServiceProcess pid, RSP_UNREGISTER_SERVICE
End Sub
Private Sub Command1_Click()
Call MakeMeService 'ʹ´°¿ÚÒþ²Ø
End Sub
Private Sub Command2_Click()
Call UnMakeMeService 'ʹ´°¿ÚÏÔʾ
End Sub
GOD_Father 2004-6-21 16:55
第二段:
'模块里内容
Private Declare Function SystemParametersInfo Lib _
"user32" Alias "SystemParametersInfoA" (ByVal uAction _
As Long, ByVal uParam As Long, ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Sub DisableCtrlAltDelete(bDisabled As Boolean)
' Disables Control Alt Delete Breaking as well as Ctrl-Escape
Dim X As Long
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
'窗体代码
Private Sub Command1_Click()
DisableCtrlAltDelete (False)
End Sub
Private Sub Command2_Click()
DisableCtrlAltDelete (True)
End Sub
GOD_Father 2004-6-21 16:56
第三段:
Option Explicit
Const SPI_SCREENSAVERRUNNING = 97
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
'=================================disable
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, "1", 0)
'=================================enable
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, "1", 0)