ludocus Posted June 12, 2008 Share Posted June 12, 2008 I want to blockinput the keyboard but not the mouse.. or I want to blockinput everything and then be able to know if anything is pressed... I don't know how to do this, some help please? Link to comment Share on other sites More sharing options...
ReaImDown Posted June 12, 2008 Share Posted June 12, 2008 I want to blockinput the keyboard but not the mouse..or I want to blockinput everything and then be able to know if anything is pressed...I don't know how to do this, some help please?I was curious about this also...lemme know if you figure something out...you'd probably have to look @ an example on http://msdn.microsoft.com/en-us/library/default.aspx then convert it to autoit... oh, and I will be on msn tomorrow around 1:00 my time [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
rasim Posted June 13, 2008 Share Posted June 13, 2008 ludocusReaImDownFor blocking keyboard you need to hook keypressings:#include <WindowsConstants.au3> Global Const $WH_KEYBOARD_LL = 13 Global $pStub_KeyProc = DllCallbackRegister("_KeyProc", "int", "int;ptr;ptr") Global $hmod = DllCall("kernel32.dll","hwnd","GetModuleHandle","ptr",0) MsgBox(4096, "", 'After pressing a "Ok" button keyboard has blocked') Global $hHook = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", _ "int", $WH_KEYBOARD_LL, _ "ptr", DllCallbackGetPtr($pStub_KeyProc), _ "hwnd", $hmod[0], _ "dword", 0) While 1 Sleep(50) WEnd DllCallbackFree($pStub_KeyProc) DllCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hHook[0]) Func _KeyProc($nCode, $wParam, $lParam) If $nCode < 0 Then Local $aRet = DllCall("user32.dll", "long", "CallNextHookEx", "hwnd", $hHook, "int", $nCode, "wparam", $wParam, _ "lparam", $lParam) Return $aRet[0] EndIf Return 1 EndFunc Link to comment Share on other sites More sharing options...
rasim Posted June 13, 2008 Share Posted June 13, 2008 ludocusReaImDownFor keyboard blocking you need to hook keypressing:#include <WindowsConstants.au3> Global Const $WH_KEYBOARD_LL = 13 Global $pStub_KeyProc = DllCallbackRegister("_KeyProc", "int", "int;ptr;ptr") Global $hmod = DllCall("kernel32.dll","hwnd","GetModuleHandle","ptr",0) MsgBox(4096, "", 'After pressing a "Ok" button keyboard has blocked') Global $hHook = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", _ "int", $WH_KEYBOARD_LL, _ "ptr", DllCallbackGetPtr($pStub_KeyProc), _ "hwnd", $hmod[0], _ "dword", 0) While 1 Sleep(50) WEnd DllCallbackFree($pStub_KeyProc) DllCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hHook[0]) Func _KeyProc($nCode, $wParam, $lParam) If $nCode < 0 Then Local $aRet = DllCall("user32.dll", "long", "CallNextHookEx", "hwnd", $hHook, "int", $nCode, "wparam", $wParam, _ "lparam", $lParam) Return $aRet[0] EndIf Return 1 EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now