//QM v2.6. Do not edit with text editor!!! //
4     6
C;;V/@4OsLFZ%@
  BlockInput2  8 2F676DF1 0
function block ;;block: 1 block keyboard, 2 block mouse, 3 block mouse and keyboard, 0 unblock, -1 unblock temporarily, -2 restore blocking

 Blocks keyboard and/or mouse input.

 Like BlockInput, input is automatically unblocked
 when macro that called BlockInput2 ends, even if it
 does not call BlockInput2 0.

 Differences from BlockInput:
   On Win98/Me:
     Ctrl+Alt+Delete cannot unblock.
   On other OS:
     Ctrl+Alt+Delete cannot unblock.
     You can block only keyboard or only mouse input.
     Other threads still can use keyboard and mouse
       commands. Blocked is only real user input.
     Other threads can temporarily unblock input.
     You can modify BIKeyboardProc to block or
       allow certain keystrokes.

 To unblock temporarily, call this function with block=-1.
 Later, you can call it again with block=-2 to restore blocking.
 Temporarily unblocking/blocking is more efficient, because
 this does not cause hooks to be uninstalled/installed. Also,
 this should be used when temporary unblocking is used in
 other thread.
 
 EXAMPLE
 BlockInput2 3
 run "notepad"
 5
 key iiii
 BlockInput2 -1
 mes "temporarily unblocked"
 BlockInput2 -2
 5
 BlockInput2 0


dll user32 #SetWindowsHookEx idHook lpfn hmod dwThreadId
dll user32 #UnhookWindowsHookEx hHook
dll user32 #CallNextHookEx hHook ncode wParam !*lParam
type KBDLLHOOKSTRUCT vkCode scanCode flags time dwExtraInfo
type MSLLHOOKSTRUCT POINT'pt mouseData flags time dwExtraInfo
def WH_KEYBOARD_LL 13
def WH_MOUSE_LL 14
def SPI_SETSCREENSAVERRUNNING 0x0061

if(WINNT)
	int+ __bikhook __bimhook __bitempunblock=0
	if(block>0)
		opt waitmsg 2
		if(__bikhook) UnhookWindowsHookEx(__bikhook)
		if(__bimhook) UnhookWindowsHookEx(__bimhook)
		if(block&1) __bikhook=SetWindowsHookEx(WH_KEYBOARD_LL &BIKeyboardProc _hinst 0)
		if(block&2) __bimhook=SetWindowsHookEx(WH_MOUSE_LL &BIMouseProc _hinst 0)
	else if(!block)
		UnhookWindowsHookEx(__bikhook); __bikhook=0
		UnhookWindowsHookEx(__bimhook); __bimhook=0
	else __bitempunblock=block=-1
else
	SystemParametersInfo(SPI_SETSCREENSAVERRUNNING block &_i 0)
	BlockInput block

  BIKeyboardProc  8 2F676591 0
 /
function nCode wParam KBDLLHOOKSTRUCT*lParam

if(nCode>=0)
	if(lParam.flags&16=0 and !__bitempunblock) ret 1

ret CallNextHookEx(__bikhook nCode wParam lParam)

  BIMouseProc  8 2F67659B 0
 /
function nCode wParam MSLLHOOKSTRUCT*lParam

if(nCode>=0)
	if(lParam.flags&1=0 and !__bitempunblock) ret 1

ret CallNextHookEx(__bimhook nCode wParam lParam)

  file  268500992 0

  