|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了,参考外洋一些网站,论坛代码,失掉以下综合,以上情况中测试经由过程,版权回原作者一切。
addacheckboxnamedchkDisable.caption="&DisableALT-TAB,ALT-ESC,CTRL-ESC,LWin,RWin,Win+Any"
toanewfromnamedfrmMain.frminnewprojecthook_kb_LL.vbp
addcodebelow:
OptionExplicit
DimhhkLowLevelKybdAsLong
PrivateSubchkDisable_Click()
IfchkDisable=vbCheckedThen
hhkLowLevelKybd=SetWindowsHookEx(WH_KEYBOARD_LL,AddressOfLowLevelKeyboardProc,App.hInstance,0)
Else
UnhookWindowsHookExhhkLowLevelKybd
hhkLowLevelKybd=0
EndIf
EndSub
PrivateSubForm_Unload(CancelAsInteger)
IfhhkLowLevelKybd0ThenUnhookWindowsHookExhhkLowLevelKybd
EndSub
innewmodulenamedmodDisableLowLevelKeys.bas
codebelow:
OptionExplicit
PublicDeclareSubCopyMemoryLib"kernel32"Alias"RtlMoveMemory"(DestinationAsAny,SourceAsAny,ByValLengthAsLong)
PublicDeclareFunctionGetKeyStateLib"user32"(ByValnVirtKeyAsLong)AsInteger
PublicDeclareFunctionSetWindowsHookExLib"user32"Alias"SetWindowsHookExA"(ByValidHookAsLong,ByVallpfnAsLong,ByValhmodAsLong,ByValdwThreadIdAsLong)AsLong
PublicDeclareFunctionCallNextHookExLib"user32"(ByValhHookAsLong,ByValnCodeAsLong,ByValwParamAsLong,lParamAsAny)AsLong
PublicDeclareFunctionUnhookWindowsHookExLib"user32"(ByValhHookAsLong)AsLong
PublicConstHC_ACTION=0
PublicConstWM_KEYDOWN=&H100
PublicConstWM_KEYUP=&H101
PublicConstWM_SYSKEYDOWN=&H104
PublicConstWM_SYSKEYUP=&H105
PublicConstVK_TAB=&H9
PublicConstVK_CONTROL=&H11
PublicConstVK_ESCAPE=&H1B
PublicConstWH_KEYBOARD_LL=13
PublicConstLLKHF_ALTDOWN=&H20
PublicTypeKBDLLHOOKSTRUCT
vkCodeAsLong
scanCodeAsLong
flagsAsLong
timeAsLong
dwExtraInfoAsLong
EndType
DimpAsKBDLLHOOKSTRUCT
PublicFunctionLowLevelKeyboardProc(ByValnCodeAsLong,ByValwParamAsLong,ByVallParamAsLong)AsLong
DimfEatKeystrokeAsBoolean
If(nCode=HC_ACTION)Then
IfwParam=WM_KEYDOWNOrwParam=WM_SYSKEYDOWNOrwParam=WM_KEYUPOrwParam=WM_SYSKEYUPThen
CopyMemoryp,ByVallParam,Len(p)
fEatKeystroke=_
((p.vkCode=VK_TAB)And((p.flagsAndLLKHF_ALTDOWN)0))Or_
((p.vkCode=VK_ESCAPE)And((p.flagsAndLLKHF_ALTDOWN)0))Or_
((p.vkCode=VK_ESCAPE)And((GetKeyState(VK_CONTROL)And&H8000)0))Or_
((p.vkCode=91)Or(p.vkCode=92)Or(p.vkCode=93))摆布Win和徽标键
EndIf
EndIf
IffEatKeystrokeThen
LowLevelKeyboardProc=-1
Else
LowLevelKeyboardProc=CallNextHookEx(0,nCode,wParam,ByVallParam)
EndIf
EndFunction
对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了, |
|