pubeoutros Posted January 17, 2020 Share Posted January 17, 2020 Hi! How can i block user interaction in just a window? For example, if i have a script running, working in an excel, i would like to block user interaction with just that window of excel while the script is running, but i would like to see what is happening with that window. I know the BlockInput function, but i just want to block user interaction with a specific window. While the script is running i would like to work in another excel window. But i don't want to by mistake open the window that the script is working and screw everything. What i was thinking is, create a 90% yellow(for example) transparent window that will always be in front of that excel window, and when i change position of the excel, that transparent window always change too. Why 90%? Because that way i know the script is running, i could only interact with the excel while the script is in a specific function (Func _Pause). First question, there is already anything to do this job? I had search but didn't find anything. Second, can anyone help me creating this almost transparent window? I know you like to see what people already tried, but this is still an idea, didn't start working in it. Thanks and i'm sorry for my english but isn't my first language. Link to comment Share on other sites More sharing options...
Nine Posted January 17, 2020 Share Posted January 17, 2020 Take a look at this snippet, it blocks all user inputs for a single window, but still allows programmatic manipulations : #include <Constants.au3> #include <GUIConstants.au3> #include <WinAPISys.au3> Opt ("MustDeclareVars", 1) Local $Form1 = GUICreate("Enable Window", 362, 190, 192, 124) Local $Label1 = GUICtrlCreateLabel("Test of Window Enable", 56, 40, 115, 17) Local $Input1 = GUICtrlCreateInput("Input1", 192, 38, 145, 21) Local $Button1 = GUICtrlCreateButton("OK", 128, 104, 89, 33) _WinAPI_EnableWindow ($Form1,False) GUISetState(@SW_SHOW) Sleep (1000) GUICtrlSetData ($Input1, "Test") ControlClick ($Form1, "", $Button1) Local $t = TimerInit () While 1 If TimerDiff ($t) > 10000 Then _WinAPI_EnableWindow ($Form1,True) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Button1 ConsoleWrite ("Button1 was pressed" & @CRLF) EndSwitch WEnd SkysLastChance and pubeoutros 2 “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...
pubeoutros Posted January 17, 2020 Author Share Posted January 17, 2020 Thank you very much Nine! I was searching in the forum for something that is already implemented in autoit. This are the moment that i see that i'm a really noob! 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