Lobico Posted July 10, 2023 Share Posted July 10, 2023 I have updated AutoIt from version 3.3.14 to 3.3.16.1, and SendKeepActive doesn't keep active the window while I use Send command. Can someone help me with this issue? Thanks in advance Link to comment Share on other sites More sharing options...
Developers Jos Posted July 10, 2023 Developers Share Posted July 10, 2023 Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 10, 2023 Developers Share Posted July 10, 2023 Would help when you show the script and an proper explanation of the issue! 😉 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Lobico Posted July 13, 2023 Author Share Posted July 13, 2023 Good morning, The code was working properly and since I install the version 3.3.16.1, it began to fail. WinActivate("Sin título: Bloc de notas") SendKeepActive("Sin título: Bloc de notas") If WinExists("Sin título: Bloc de notas")=1 Then Send("pepe") EndIf Sleep(4000) If WinExists("*Sin título: Bloc de notas")=1 Then Send("pepe") EndIf Sleep(4000) If WinExists("*Sin título: Bloc de notas")=1 Then Send("pepe") EndIf SendKeepActive("") I have put sleep between send to change the window manually, and it doesn't returns focus on "Sin título: Bloc de notas". If I generate the executable file in 3.3.14, I don't have any problem. Thanks in advance Jos Link to comment Share on other sites More sharing options...
bogQ Posted July 13, 2023 Share Posted July 13, 2023 (edited) edit: nwm totaly missclicked in brain for operator usage Edited July 13, 2023 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 27, 2023 Developers Share Posted July 27, 2023 (edited) Think your title changed after the first send, as you have also changed in the WinExists() function: Quote SendKeepActive("Sin título: Bloc de notas") If WinExists("Sin título: Bloc de notas")=1 Then Send("pepe") EndIf Sleep(4000) If WinExists("*Sin título: Bloc de notas")=1 Then Send("pepe") EndIf So try as it is done in the example provided by the helpfile and use the class like this which works fine: Run("notepad.exe") ; Wait max 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:Notepad]", "", 10) ; Keep the Notepad window active when using the Send function. SendKeepActive("[CLASS:Notepad]") If WinExists("[CLASS:Notepad]") Then Send("pepe") EndIf Sleep(4000) If WinExists("[CLASS:Notepad]") Then Send("pepe") EndIf Sleep(4000) If WinExists("[CLASS:Notepad]") Then Send("pepe") EndIf SendKeepActive("") Edited July 27, 2023 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Zedna Posted July 27, 2023 Share Posted July 27, 2023 (edited) I think even better could be (not tested just idea!) Run("notepad.exe") ; Wait max 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:Notepad]", "", 10) ; Keep the Notepad window active when using the Send function. SendKeepActive($hWnd) If WinExists($hWnd) Then Send("pepe") EndIf Sleep(4000) If WinExists($hWnd) Then Send("pepe") EndIf Sleep(4000) If WinExists($hWnd) Then Send("pepe") EndIf SendKeepActive("") Edited July 27, 2023 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Lobico Posted August 7, 2023 Author Share Posted August 7, 2023 Thanks, both codes works properly if you run them in debug. But they doesn't work with build file. I don't know if the problem is the configuration of compiler. I add a screenshot of the compiler. After you run the file, if you change the active window, it doesn't return to "Notepad" 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