Nine 932 Posted July 30, 2019 This function can be use to block all inputs coming from mouse and keyboard, without having an UAC warning displayed. Example : #include <Constants.au3> #include "BlockInputEX.au3" Opt ("MustDeclareVars", 1) _BlockInput ($BI_DISABLE) ; block input ConsoleWrite (@error & @CRLF) _BlockInput ($BI_DISABLE) ; @error is set since already disable ConsoleWrite (@error & @CRLF) Sleep (10000) _BlockInput ($BI_ENABLE ) ; enable input ConsoleWrite (@error & @CRLF) _BlockInput ($BI_ENABLE ) ; @error is set since already enable ConsoleWrite (@error & @CRLF) BlockInputEX.au3 1 mLipok reacted to this Not much of a signature, but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Tool to search content in au3 files Date Range Picker Sudoku Game 2020 Overlapped Named Pipe IPC x64 Bitwise Operations Fast and simple WCD IPC GIF Animation (cached) Share this post Link to post Share on other sites
BigDaddyO 61 Posted September 16, 2019 (edited) Great work on this Nine! Just because I'm super lazy and I just needed this to resolve a ControlSend issue, I created this from your code. It's used just like you would ControlSend, but it blocks and unblocks keyboard and mouse during the process. ; #FUNCTION# ==================================================================================================================== ; Name...........: _ControlSendSecure ; Description ...: Block all mouse and keyboard inputs, Sends Text to the control, then Unblocks all mouse and keyboard inputs ; Syntax.........: _ControlSendSecure() ; Parameters ....: ; Return values .: Success - Returns 1 ; Failure - Returns 0 ; Author ........: BigDaddyO, based off Nines _BlockInputEx ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _ControlSendSecure($s_Title, $s_Text, $s_ControlID, $s_Value, $bFlag = 0) $g_hStub_KeyProc = DllCallbackRegister("_BlockInput_MouseKeyProc", "long", "int;wparam;lparam") $g_hStub_MouseProc = DllCallbackRegister("_BlockInput_MouseKeyProc", "long", "int;wparam;lparam") Local $hMod = _WinAPI_GetModuleHandle(0) $g_hHook1 = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($g_hStub_KeyProc), $hMod) $g_hHook2 = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($g_hStub_MouseProc), $hMod) $iRet = ControlSend($s_Title, $s_Text, $s_ControlID, $s_Value, $bFlag) _WinAPI_UnhookWindowsHookEx($g_hHook1) _WinAPI_UnhookWindowsHookEx($g_hHook2) DllCallbackFree($g_hStub_KeyProc) DllCallbackFree($g_hStub_MouseProc) Return $iRet EndFunc Edited September 16, 2019 by BigDaddyO 1 mLipok reacted to this hmm... I guess I have to have a signature... Share this post Link to post Share on other sites
Nine 932 Posted September 16, 2019 lol, when udf is simple enough, you can do anything with it.Great it worked for you. Not much of a signature, but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Tool to search content in au3 files Date Range Picker Sudoku Game 2020 Overlapped Named Pipe IPC x64 Bitwise Operations Fast and simple WCD IPC GIF Animation (cached) Share this post Link to post Share on other sites
mikell 1,014 Posted October 4, 2019 @Nine Nice UDF , you could give it an other name though because this one was already used Share this post Link to post Share on other sites
Nine 932 Posted October 4, 2019 @mikell, thanks, I didn't know. I'll thing about a new name... Not much of a signature, but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Tool to search content in au3 files Date Range Picker Sudoku Game 2020 Overlapped Named Pipe IPC x64 Bitwise Operations Fast and simple WCD IPC GIF Animation (cached) Share this post Link to post Share on other sites