禁用Alt-Tab或Ctrl-Alt-Del

2018-06-17 17:12:41来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

PrivateDeclareFunctionEnableWindowLib"user32"(ByValhWndAsInteger,ByValaBOOLAsInteger)AsInteger
PrivateDeclareFunctionIsWindowEnabledLib"user32"(ByValhWndAsInteger)AsInteger
PrivateDeclareFunctionGetMenuLib"user32"(ByValhWndAsInteger)AsInteger
PrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVallpWindowNameAsString)AsLong
PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,ByVallpvParamAsAny,ByValfuWinIniAsLong)AsLong
PrivateTaskBarhWndAsLong
PrivateIsTaskBarEnabledAsInteger
PrivateTaskBarMenuHwndAsInteger

'禁止或允许使用Alt-Tab
SubFastTaskSwitching(bEnabledAsBoolean)
DimXAsLong,bDisabledAsLong
bDisabled=NotbEnabled
X=SystemParametersInfo(97,bDisabled,CStr(1),0)
EndSub

'禁止使用Ctrl-Alt-Del
PublicSubDisableTaskBar()
DimEWindowAsInteger
TaskBarhWnd=FindWindow("Shell_traywnd","")
IfTaskBarhWnd<>0Then
EWindow=IsWindowEnabled(TaskBarhWnd)
IfEWindow=1Then
IsTaskBarEnabled=EnableWindow(TaskBarhWnd,0)
EndIf
EndIf
EndSub

'允许使用Ctrl-Alt-Del

PublicSubEnableTaskBar()
IfIsTaskBarEnabled=0Then
IsTaskBarEnabled=EnableWindow(TaskBarhWnd,1)
EndIf
EndSub

'禁止Ctrl Alt Del
'声明(ForWin95):

ConstSPI_SCREENSAVERRUNNING=97
PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,lpvParamAsAny,ByValfuWinIniAsLong)AsLong
使用:
'禁止
DimpOldAsBoolean
CallSystemParametersInfo(SPI_SCREENSAVERRUNNING,True,pOld,0)
'开启
DimpOldAsBoolean
CallSystemParametersInfo(SPI_SCREENSAVERRUNNING,False,pOld,0)

->

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:VisualBasic让表单一开始就显示在荧幕中央(不含工作列)

下一篇:如何做旋转的光盘动画