Gameday Posted May 18, 2011 Share Posted May 18, 2011 I had a problem yesterday with some of the commands sent to a cmd.exe turning up differently ( ). It turned out to be kind of a race condition. I was doing a WinActivate and then immediately going for the send. Somehow, when I sent something like dir && ls to cmd.exe, it got there as dir 77 ls. I added a Sleep after the WinActivate and the Send, and everything turned out ok. How long does it usualy take for WinActivate, to activate? Is it posting a message, and everything happens later? Is there another function I could call, that would happen immediately? I'd like to make sure that my window is really active when I'm trying to send. Link to comment Share on other sites More sharing options...
Warmonger Posted May 18, 2011 Share Posted May 18, 2011 (edited) I had a problem yesterday with some of the commands sent to a cmd.exe turning up differently ( ). It turned out to be kind of a race condition. I was doing a WinActivate and then immediately going for the send. Somehow, when I sent something like dir && ls to cmd.exe, it got there as dir 77 ls. I added a Sleep after the WinActivate and the Send, and everything turned out ok.How long does it usualy take for WinActivate, to activate? Is it posting a message, and everything happens later? Is there another function I could call, that would happen immediately? I'd like to make sure that my window is really active when I'm trying to send.Look at WinWaitActive in the help file. Edited May 18, 2011 by Warmonger [AutoIt File Patcher] Link to comment Share on other sites More sharing options...
Gameday Posted May 18, 2011 Author Share Posted May 18, 2011 Hi WarMonger! I know of the WinWaitActive, but the following combination didn't seem to work yesterday: WinActivate("My Window") WinWaitActive("My Window") After I called WinWaitActive, the only way my code continued was if I made it active by clicking on it. My AutoIt script is running on a remote computer, automating part of a build process , and I will not be able to activate it manually. 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