anhyeuem Posted March 2, 2014 Share Posted March 2, 2014 this is a pefect UDF It is useful for everybody. Can you tell me with: disable mouse right or block mouse right. My script will disable copy and paste. Teach me, please Link to comment Share on other sites More sharing options...
Qwerty212 Posted March 2, 2014 Share Posted March 2, 2014 this is a pefect UDF It is useful for everybody. Can you tell me with: disable mouse right or block mouse right. My script will disable copy and paste. Teach me, please You can just put this inside a loop: ClipPut("") Greets from Barcelona anhyeuem 1 Link to comment Share on other sites More sharing options...
anhyeuem Posted March 2, 2014 Share Posted March 2, 2014 can you tell me more about your "ClipPut" information. I am newbie. I have just used: {MSDOWN}|{MSUP} for disable right mouse Link to comment Share on other sites More sharing options...
Qwerty212 Posted March 2, 2014 Share Posted March 2, 2014 can you tell me more about your "ClipPut" information. I am newbie. I have just used: {MSDOWN}|{MSUP} for disable right mouse ClipPut writes in the clipboard whatever you want. So you can put ClipPut inside a loop and your script will let you copy (with the mouse or with Control+C with the keyboard) and inmediatly the content of the clilpboard will be changed with empty data. Try this example: #NoTrayIcon ;put this at the top of your script to don't show any tray icon HotKeySet("{ESC}", "_Exit") ;If you press ESC the script will stop While 1 ;the loop ClipPut("") Sleep (20) ; a little sleep to don't use a lot of cpu Wend Func _Exit() ;a little function to exit Exit EndFunc ;==> _Exit() And while your script is running you'll never be able of paste anything. Greets from Barcelona anhyeuem 1 Link to comment Share on other sites More sharing options...
anhyeuem Posted March 2, 2014 Share Posted March 2, 2014 ClipPut writes in the clipboard whatever you want. So you can put ClipPut inside a loop and your script will let you copy (with the mouse or with Control+C with the keyboard) and inmediatly the content of the clilpboard will be changed with empty data. Try this example: #NoTrayIcon ;put this at the top of your script to don't show any tray icon HotKeySet("{ESC}", "_Exit") ;If you press ESC the script will stop While 1 ;the loop ClipPut("") Sleep (20) ; a little sleep to don't use a lot of cpu Wend Func _Exit() ;a little function to exit Exit EndFunc ;==> _Exit() And while your script is running you'll never be able of paste anything. Greets from Barcelona Value: i want more and more: ClipPut("{Ctrl}") but i need {Ctrl}, {AppsKey} = Context menu, rightmouse click, Link to comment Share on other sites More sharing options...
Qwerty212 Posted March 2, 2014 Share Posted March 2, 2014 Value: i want more and more: ClipPut("{Ctrl}") but i need {Ctrl}, {AppsKey} = Context menu, rightmouse click, Uuuuuh, sorry, could you please explain a little bit more what do you want to do? Thanks Link to comment Share on other sites More sharing options...
anhyeuem Posted March 4, 2014 Share Posted March 4, 2014 Uuuuuh, sorry, could you please explain a little bit more what do you want to do? Thanks thank you so much because reply. my case, i want disable: "Ctrl" and "AppsKey" (AppsKey = Context menu, it near Ctrl, it like click right mouse) and "rightmouse click" Link to comment Share on other sites More sharing options...
Supergrobi1968 Posted September 22, 2014 Share Posted September 22, 2014 Hi, first of all. Very useful UDF. Thanks for sharing. May I ask to extend this UDF a little bit. It would be great and would solve a big problem for me when it would still be possible to send something with the SEND Command to (for example) a window, because at the moment it seems that the UDF will block simply everything. I need/want still to send text via the SEND Command. Thanks alot. Kind Regards Supergrobi Link to comment Share on other sites More sharing options...
lalalaura Posted October 28, 2016 Share Posted October 28, 2016 Hi all... thank you for this udf. My problem is that I'm having the same issue than AcidUser mentioned a few posts ago. I'm testing a script on an rdp session and if I use Ctrl+Alt+Del I'm still able to unlock the input. I'm using _BlockInputEx(1) Can someone help me with this? Link to comment Share on other sites More sharing options...
MattHiggs Posted October 29, 2016 Share Posted October 29, 2016 Very nice sir. I have always been a bit disappointed with the built in block input function. Whenever I write a script meant for an end user and it requires manipulation of a window or its associated controls, I always block the input so they don't screw something up then call me wondering why. However, if something ELSE were to happen (another window is focused, etc) then they are essentially stuck until they (CTRL + ALT + DEL). BTW, I haven;t tried this yet, but is there a way to make it so that even when CTRL + ALT + DEL is pressed, even if the screen pops up, the input is still frozen when user cancels back to the desktop? That would be useful also. Link to comment Share on other sites More sharing options...
Trax Posted March 31, 2017 Share Posted March 31, 2017 (edited) I have been using this script for years and have never figured out whit anyone would want to block input based on a Windows. There has never been a real good explanation of how that works. Even the examples are lacking in documentation. Does anyone block by Window and if so can you explain it to me? Actually I might get lucky and get a response so I will elaborate a little. I want an overall block for everything but... if a certain Window is active I want to specify blocks for that specific Windows. So I am obviously going to have to allow double mouse clicks overall so users can open programs but at that point will the blocks for the active Window be in place until some other Window becomes active at which point it will revert to allowing just the double clock again? Edited March 31, 2017 by Trax Link to comment Share on other sites More sharing options...
vipcxj Posted December 8, 2018 Share Posted December 8, 2018 A lot of bug, such as blocking MouseMove even if $iBlockAllInput=0 and crash when release the callback. I fix it and upload the fixed version BlockInputEx.rar Link to comment Share on other sites More sharing options...
LukeLe Posted October 19, 2019 Share Posted October 19, 2019 On 1/13/2010 at 12:13 AM, Homes32 said: I am trying to block input to everything but a particular window. I have tried using the following code with no success. is this possible with your UDF? or is $hWindows only intended to control blocking FOR a specific window? -Homes32 On 5/20/2013 at 6:52 AM, JohnOne said: I've seen similar questions to this one asked "regarding windows" but as yet unanswered. I'm wondering if it possible with your UDF's to accomplish the following... Block UP DOWN LEFT RIGHT to all but autoit window. The goal is to give these keys mouse functionality, but without interacting with any active windows such as scrolling a webpage or any other application specific tasks. I think we need to detect the window by ourselves, then whenever the target window has Focus, just call `_BlockInputEx(0)` and when it's lost focus, lock again Wondering who uses AutoIT and what it can be used for? Link to comment Share on other sites More sharing options...
KAILA Posted September 19, 2020 Share Posted September 19, 2020 On 8/4/2010 at 2:14 PM, MrCreatoR said: ... ;Here we block only tthishe following keyboard keys (try to press them 😞 pro ; 0x31 = "1" ; 0x32 = "2" ; 0x33 = "3" ; 0x61 = "Numpad1" ; 0x62 = "Numpad2" ; 0x63 = "Numpad3" ;_BlockInputEx(1, "", "0x31|0x32|0x33|0x61|0x62|0x63") _BlockInputEx(1, "", "1|2|3|{NUMPAD1}|{NUMPAD2}|{NUMPAD3}") ;The same as previous commented line ... hello i have this problem can any one help please thancks in the script wen i try to run it undefined function Link to comment Share on other sites More sharing options...
KAILA Posted September 19, 2020 Share Posted September 19, 2020 in this line i have the problem i am new in this thancks _BlockInputEx(1, "", "1|2|3|{NUMPAD1}|{NUMPAD2}|{NUMPAD3}") ;The same as previous commented line Link to comment Share on other sites More sharing options...
KAILA Posted September 19, 2020 Share Posted September 19, 2020 On 10/23/2010 at 2:34 PM, zwierzak said: how to block ONLY ctrl+alt+del hello thancks loocking for help in this srcipt wen i run this it give error in the red line say undefined function thanks # include <BlockInputEx.au3> ;================== CLASSes usage Example ================== HotKeySet("{ESC}", "_Quit") ;This will trigger an exit _BlockInputEx(3,"", "{LCTRL}|{RCTRL}|{ALT}|{DEL}|^!+{DEL}") ;This is only for testing, so if anything go wrong, the script will exit after 10 seconds. AdlibRegister("_Quit", 10000) While 1 Sleep(100) WEnd Func _Quit() Exit EndFunc Link to comment Share on other sites More sharing options...
Nine Posted September 19, 2020 Share Posted September 19, 2020 You CANNOT block ctrl-alt-del. You can know if that sequence of keys has been pressed, but you cannot block it. Make sense after all. And please use this tool when you post code. If you want a fast block input, see my sig.... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
WinMacBear Posted December 11, 2020 Share Posted December 11, 2020 (edited) this function will stop working after using ... or after mousemove() Edited December 11, 2020 by WinMacBear Link to comment Share on other sites More sharing options...
Zehir Posted November 24, 2022 Share Posted November 24, 2022 (edited) It always hard-crashes for me IF I use a window handle and IF I'm trying to move the blocked mouse just before the unblock (_BlockInputEx(0)). I modified the __BlockInputEx_UnhookWinHooks_Proc() function just a bit and it now works fine for me when I use a window handle : Original : ;Releases callbacks and Unhook Windows hooks Func __BlockInputEx_UnhookWinHooks_Proc() ;Release KeyBoard callback function If $ah_MouseKeyboard_WinHooks[0] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[0]) $ah_MouseKeyboard_WinHooks[0] = 0 EndIf ;Release Mouse callback function If $ah_MouseKeyboard_WinHooks[1] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[1]) $ah_MouseKeyboard_WinHooks[1] = 0 EndIf ;Release KeyBoard Window hook If IsPtr($ah_MouseKeyboard_WinHooks[2]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[2]) $ah_MouseKeyboard_WinHooks[2] = 0 EndIf ;Release Mouse Window hook If IsPtr($ah_MouseKeyboard_WinHooks[3]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[3]) $ah_MouseKeyboard_WinHooks[3] = 0 EndIf Return 1 EndFunc Modified : ;Releases callbacks and Unhook Windows hooks Func __BlockInputEx_UnhookWinHooks_Proc() ;Release KeyBoard Window hook If IsPtr($ah_MouseKeyboard_WinHooks[2]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[2]) $ah_MouseKeyboard_WinHooks[2] = 0 EndIf ;Release Mouse Window hook If IsPtr($ah_MouseKeyboard_WinHooks[3]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[3]) $ah_MouseKeyboard_WinHooks[3] = 0 EndIf ;Release KeyBoard callback function If $ah_MouseKeyboard_WinHooks[0] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[0]) $ah_MouseKeyboard_WinHooks[0] = 0 EndIf ;Release Mouse callback function If $ah_MouseKeyboard_WinHooks[1] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[1]) $ah_MouseKeyboard_WinHooks[1] = 0 EndIf Return 1 EndFunc It seems that the window hooks must be released before the callbacks are. Your oldest changelog entry mentioning a hard-crash with winhandles related to window hooks not being released gave me a clue. Edited November 24, 2022 by Zehir Link to comment Share on other sites More sharing options...
Zehir Posted November 24, 2022 Share Posted November 24, 2022 (edited) Also I am unable to use the native AutoIT MouseClick(), MouseMove() and ControlClick() functions while the user mouse is blocked, even with #RequireAdmin. Edited November 24, 2022 by Zehir 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