1个回答
2013-09-23
展开全部
这个程序能够完全禁止开始菜单,而且能够恢复开始菜单,ctrl+esc和win键都不管用,但是在xp,2k下还是能够通过taskmgr.exe(任务管理器)运行新的程序,所以还要禁止ctrl+alt+del。
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 Boolean
Private 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 Sub
Private 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 Sub
Private Sub Form_Unload(Cancel As Integer)
If bswap Then
SetParent win, task
ShowWindow win, 1
End If
End Sub
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 Boolean
Private 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 Sub
Private 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 Sub
Private Sub Form_Unload(Cancel As Integer)
If bswap Then
SetParent win, task
ShowWindow win, 1
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询