By disable

xiaoxiao2021-03-06  52

Code Sharing] About Win2K / NT / XP Environment LWIN, RWIN, WIN ANY, CTRL ESC, Alt Esc, Alt Tab Mocks Select from Yinweihong's Blog Keyword [Code Sharing] About Win2K / NT / In XP Environment, LWIN, RWIN, WIN ANY, CTRL ESC, ALT ESC, Alt Tab, etc. For some other websites, forum code, get the following synthesis, pass the above environment, copyright belongs to the original author.

add a checkbox named chkDisable.caption = "& Disable ALT-TAB, ALT-ESC, CTRL-ESC, LWin, RWin, Win Any" to a new from named frmMain.frm in new project hook_kb_LL.vbpadd code below: Option Explicit Dim hhkLowLevelKybd As Long Private Sub chkDisable_Click () If chkDisable = vbChecked Then hhkLowLevelKybd = SetWindowsHookEx (WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, App.hInstance, 0) Else UnhookWindowsHookEx hhkLowLevelKybd hhkLowLevelKybd = 0End IfEnd Sub Private Sub Form_Unload (Cancel As Integer) If hhkLowLevelKybd <> 0 Then UnhookWindowsHookEx hhkLowLevelKybdEnd Sub in new module named modDisableLowLevelKeys.bascode below: Option Explicit Public Declare Sub CopyMemory Lib "kernel32" Alias ​​"RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) Public Declare Function GetKeyState Lib "user32" (ByVal NVIRTKEY As Long Function SetWindowsHookex Lib "User32" Alias ​​"Setwindowshookexa" (Byval LPFN As Long, Byval HMOD As Long, BYVAL HMOD AS Long Val dwThreadId As Long) As LongPublic Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lParam As Any) As LongPublic Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As LongPublic Const HC_ACTION = 0Public Const WM_KEYDOWN = & H100Public Const WM_KEYUP = & H101Public Const WM_SYSKEYDOWN = & H104Public Const WM_SYSKEYUP = & H105Public Const VK_TAB = & H9Public Const VK_CONTROL = & H11Public Const VK_ESCAPE = & H1B Public Const WH_KEYBOARD_LL = 13Public Const LLKHF_ALTDOWN = &

转载请注明原文地址:https://www.9cbs.com/read-115570.html

New Post(0)