当然能 *API函数声明 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) Dim X As Long X = SystemParametersInfo(97, bDisabled, CStr(1), 0) End Sub 使Ctrl-Alt-Delete无效 : Call DisableCtrlAltDelete(True) 恢复Ctrl-Alt-Delete : Call DisableCtrlAltDelete(False)
Win98下蔽掉 ctrl+del+altPublic Declare Function GetCurrentProcessId Lib “kernel32” () As Long ’获得当前进程ID函数的声明 Public Declare Function RegisterServiceProcess Lib “kernel32” (ByVal ProcessId As Long, ByVal ServiceFlags As Long) As Long '窗体Private Sub Form_Load() RegisterServiceProcess GetCurrentProcessId, 1 ’ 从系统中取消当前进程 end subPrivate Sub Form_Unload(Cancel As Integer) RegisterServiceProcess GetCurrentProcessId, 0 ’从系统中取消当前程序的进程 End Sub Win2000/XP下屏蔽CTRL+ALT+DEL http://expert.csdn.net/Expert/topic/2374/2374876.xml?temp=.312298 http://expert.csdn.net/Expert/TopicView1.asp?id=2086886 http://expert.csdn.net/Expert/TopicView1.asp?id=2019647 http://expert.csdn.net/Expert/topic/2019/2019647.xml?temp=.8485681 http://expert.csdn.net/Expert/topic/2394/2394203.xml?temp=.4765589 http://expert.csdn.net/Expert/topic/2333/2333641.xml?temp=2.935427E-02编写小函数如下: 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 LongSub DisableCtrlAltDelete(bDisabled As Boolean) Dim X As Long X = SystemParametersInfo(97, bDisabled, CStr(1), 0) End Sub 程序设计时如果需要屏蔽Ctrl-Alt-Delete按键,可以书写 Call DisableCtrlAltDelete(True),如果需要恢复原状,可以书写Call DisableCtrlAltDelete(False)。
咳,楼上的都是在98下屏蔽Ctrl-Alt-Delete
Option Explicit Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Dim task As Long Dim win As Long Dim bswap As BooleanPrivate Sub Command1_Click() If Not bswap Then SetParent win, Me.hwnd ShowWindow win, 0 Else SetParent win, task ShowWindow win, 1 End If bswap = Not bswap End SubPrivate Sub Form_Load() task = FindWindow("Shell_TrayWnd", vbNullString) If task Then win = FindWindowEx(task, 0, "Button", vbNullString) If win Then Else MsgBox "没有找到开始按钮" Unload Me End If Else MsgBox "没有找到任务栏" Unload Me End If End SubPrivate Sub Form_Unload(Cancel As Integer) If bswap Then SetParent win, task ShowWindow win, 1 End If End Sub
*API函数声明
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)
Dim X As Long
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
使Ctrl-Alt-Delete无效 :
Call DisableCtrlAltDelete(True)
恢复Ctrl-Alt-Delete :
Call DisableCtrlAltDelete(False)
http://expert.csdn.net/Expert/topic/2394/2394203.xml?temp=.358227
http://expert.csdn.net/Expert/topic/2374/2374876.xml?temp=.312298
http://expert.csdn.net/Expert/TopicView1.asp?id=2086886
http://expert.csdn.net/Expert/topic/2086/2086886.xml?temp=.6452753http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=172328
’获得当前进程ID函数的声明
Public Declare Function RegisterServiceProcess Lib “kernel32” (ByVal ProcessId As Long, ByVal ServiceFlags As Long) As Long '窗体Private Sub Form_Load()
RegisterServiceProcess GetCurrentProcessId, 1 ’ 从系统中取消当前进程
end subPrivate Sub Form_Unload(Cancel As Integer)
RegisterServiceProcess GetCurrentProcessId, 0 ’从系统中取消当前程序的进程
End Sub
Win2000/XP下屏蔽CTRL+ALT+DEL
http://expert.csdn.net/Expert/topic/2374/2374876.xml?temp=.312298
http://expert.csdn.net/Expert/TopicView1.asp?id=2086886
http://expert.csdn.net/Expert/TopicView1.asp?id=2019647
http://expert.csdn.net/Expert/topic/2019/2019647.xml?temp=.8485681
http://expert.csdn.net/Expert/topic/2394/2394203.xml?temp=.4765589
http://expert.csdn.net/Expert/topic/2333/2333641.xml?temp=2.935427E-02编写小函数如下:
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 LongSub DisableCtrlAltDelete(bDisabled As Boolean)
Dim X As Long
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
程序设计时如果需要屏蔽Ctrl-Alt-Delete按键,可以书写
Call DisableCtrlAltDelete(True),如果需要恢复原状,可以书写Call
DisableCtrlAltDelete(False)。
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Dim task As Long
Dim win As Long
Dim bswap As BooleanPrivate Sub Command1_Click()
If Not bswap Then
SetParent win, Me.hwnd
ShowWindow win, 0
Else
SetParent win, task
ShowWindow win, 1
End If
bswap = Not bswap
End SubPrivate Sub Form_Load()
task = FindWindow("Shell_TrayWnd", vbNullString)
If task Then
win = FindWindowEx(task, 0, "Button", vbNullString)
If win Then
Else
MsgBox "没有找到开始按钮"
Unload Me
End If
Else
MsgBox "没有找到任务栏"
Unload Me
End If
End SubPrivate Sub Form_Unload(Cancel As Integer)
If bswap Then
SetParent win, task
ShowWindow win, 1
End If
End Sub