编程语言 程序设计交流站


Join the forum, it's quick and easy

编程语言 程序设计交流站
编程语言 程序设计交流站
Would you like to react to this message? Create an account in a few clicks or log in to continue.
编程语言 程序设计交流站

欢迎关顾本站,在这里你可以畅所欲言,提出你要解决的问题,各路高手会给你一个圆满的答复,另外有各种源代码、源程序等供你下载。vb vc c++ c# delphi 易语言 Java PASCAL VFP JS VBS Pascal SQL...>


您没有登录。 请登录注册

禁用 Alt-Tab 或 Ctrl-Alt-Del

向下  留言 [第1页/共1页]

1禁用 Alt-Tab 或 Ctrl-Alt-Del Empty 禁用 Alt-Tab 或 Ctrl-Alt-Del 2012-07-18, 6:49 pm

Admin

Admin
Admin

Private Declare Function EnableWindow Lib "user32" (ByVal hWnd As Integer, ByVal aBOOL As Integer) As Integer
Private Declare Function IsWindowEnabled Lib "user32" (ByVal hWnd As Integer) As Integer
Private Declare Function GetMenu Lib "user32" (ByVal hWnd As Integer) As Integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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
Private TaskBarhWnd As Long
Private IsTaskBarEnabled As Integer
Private TaskBarMenuHwnd As Integer
'禁止或允许使用 Alt-Tab
Sub FastTaskSwitching(bEnabled As Boolean)
Dim X As Long, bDisabled As Long
bDisabled = Not bEnabled
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub

'禁止使用Ctrl-Alt-Del
Public Sub DisableTaskBar()
Dim EWindow As Integer
TaskBarhWnd = FindWindow("Shell_traywnd", "")
If TaskBarhWnd <> 0 Then
EWindow = IsWindowEnabled(TaskBarhWnd)
If EWindow = 1 Then
IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 0)
End If
End If
End Sub

'允许使用Ctrl-Alt-Del

Public Sub EnableTaskBar()
If IsTaskBarEnabled = 0 Then
IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 1)
End If
End Sub

'禁止 Ctrl+Alt+Del
'声明(For Win95):

Const SPI_SCREENS***ERRUNNING = 97
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
使用:
'禁止
Dim pOld As Boolean
Call SystemParametersInfo(SPI_SCREENS***ERRUNNING, True, pOld, 0)
'开启
Dim pOld As Boolean
Call SystemParametersInfo(SPI_SCREENS***ERRUNNING, False, pOld, 0)

http://proj.my-rpg.com

返回页首  留言 [第1页/共1页]

您在这个论坛的权限:
不能在这个论坛回复主题