aGorilla Posted April 25, 2008 Share Posted April 25, 2008 Thanks to flip209, my app is no longer sleep()ing.But now I'm a bit confused by the solution. I had seen WinWaitActive, and didn't think it would apply to that problem. In my eyes, the IE window was clearly 'active', it just hadn't finished loading.That leaves me guessing that 'Active' means 'ready for user input'. Is that correct, or is it something else? Search AutoItScript.com via Google Link to comment Share on other sites More sharing options...
rudi Posted April 25, 2008 Share Posted April 25, 2008 Hi.That leaves me guessing that 'Active' means 'ready for user input'. Is that correct, or is it something else?AFAIK a window is "active" as soon as it's the window with the "active title bar", with the "pressed task button" in the task bar, regardless of if it's ready to take input or not.Let a seccond Autoit3 script run to report (GUI, label) what's the currently active window.Hope this helps.Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
flip209 Posted April 25, 2008 Share Posted April 25, 2008 WinWaitActive -------------------------------------------------------------------------------- Pauses execution of the script until the requested window is active. WinWaitNotActive -------------------------------------------------------------------------------- Pauses execution of the script until the requested window is not active. Directly out of the help file.... " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
flip209 Posted April 25, 2008 Share Posted April 25, 2008 Instead of winwaitactive you can use _IELoadWait " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
aGorilla Posted April 25, 2008 Author Share Posted April 25, 2008 I'll repost my original problem here, for some context:I'm navigating through an admin, I click on a link using _IEAction($link, "click") (it's a javascript link, do I have a choice?), it makes a popup window.At first, when I tried to get the window with something like this:$popup = WinGetHandle ( 'Upload File - Microsoft Internet Explorer' )Sometimes it would work, sometimes it wouldn't.I put a sleep(3000) before the WinGetHandle, and that seems to have fixed it.@rudi: That's what I thought, but in this case, it's definitely waiting until the page loads.@flip209: The docs are a bit vague about the meaning of 'active', which is why I asked. I tried _IELoadWait, but it was working with the 'current' browser, remember, I had created a popup, and needed to wait for it before I could grab the handle, so there was no way to _IELoadWait (I think), because I didn't have a reference to that window yet. Search AutoItScript.com via Google Link to comment Share on other sites More sharing options...
flip209 Posted April 25, 2008 Share Posted April 25, 2008 #include <IE.au3> $iesite = _IE_Example ("form") _IELoadWait($iesite) MsgBox(0, "Loaded", "Google on") " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln 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