Champak Posted January 29, 2009 Share Posted January 29, 2009 AutoIt Window Info sees the window, but WinExists can't. I've tried the following and neither are seeing it: If WinExists("Internet Explorer", "Internet Explorer has encountered a problem and needs to close.") Then MsgBox(0,0,"test") ControlClick("Internet Explorer", "Internet Explorer has encountered a problem and needs to close.", 1001) EndIfoÝ÷ Ù©Ýjëh×6 If WinExists("Internet Explorer", "If you were in the middle of something, the information you were working on might be lost") Then MsgBox(0,0,"test") ControlClick("Internet Explorer", "If you were in the middle of something, the information you were working on might be lost", 1001) EndIf Attached are the images of what is happening. Any ideas/workarounds? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 29, 2009 Share Posted January 29, 2009 AutoIt Window Info sees the window, but WinExists can't. Did you verify the Title with AU3Info? I see it on screenshot, but maybe that's graphical and the real title is not displayed...? If that doesn't help, go with class (i.e. "[CLASS:#32770]") and the text, instead of the title. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Champak Posted January 29, 2009 Author Share Posted January 29, 2009 Yes I did verify the title. And going with class doesn't work either. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 29, 2009 Share Posted January 29, 2009 (edited) Yes I did verify the title. And going with class doesn't work either. Interesting. If that is the active window, run this and see what you get: Sleep(30000); You've got 30 sec to make the error popup active $hWin = WinGetHandle("[ACTIVE]") $sTitle = WinGetTitle($hWin) $sText = WinGetText($hWin) $tBuffer = DllStructCreate("char Buffer[256]") $pBuffer = DllStructGetPtr($tBuffer) $iBuffer = DllStructGetSize($tBuffer) $avRET = DllCall("user32.dll", "int", "GetClassNameA", "hwnd", $hWin, "ptr", $pBuffer, "int", $iBuffer) $sCLASS = DllStructGetData($tBuffer, "Buffer") $iExists = WinExists("[CLASS:" & $sCLASS & "]") $sMsg = "HWND = " & $hWin & @CRLF & _ "Title = " & $sTitle & @CRLF & _ "Text = " & $sText & @CRLF & _ "Class = " & $sCLASS & @CRLF & _ "Exists = " & $iExists & @CRLF & @CRLF For $n = 0 To UBound($avRET) - 1 $sMsg &= "$avRET[" & $n & "] = " & $avRET[$n] & @CRLF Next MsgBox(64, "Window", $sMsg) Edit1: Updated code to get CLASS also. Edit2: Oops. Raw DLL call was not required to get class. There is a UDF already: _WinAPI_GetClassName() Edited January 29, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Champak Posted January 29, 2009 Author Share Posted January 29, 2009 Here is the result...same info as the info window. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 29, 2009 Share Posted January 29, 2009 Here is the result...same info as the info window. Try: WinWait("[CLASS:#32770; TITLE:Internet Explorer]") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Champak Posted January 30, 2009 Author Share Posted January 30, 2009 Are you saying that to test to see if the same thing happens, or to use it in place of "Exists"? Because "Wait" wont work for what I'm doing, the "Exists" is going in the main loop. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 30, 2009 Share Posted January 30, 2009 Are you saying that to test to see if the same thing happens, or to use it in place of "Exists"? Because "Wait" wont work for what I'm doing, the "Exists" is going in the main loop.Just a dumb typo on my part: I meant use that match string in WinExsists(). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Champak Posted February 2, 2009 Author Share Posted February 2, 2009 So here is what my tests have shown. 1/ The problem happens either during navigate or loadwait 2/ The winExists is not being seen in the loop because the function is not ending and going back to the loop. 3/ This only happens when the DebugBar toolbar is open...even when the window is hidden. So I believe I would have to put the WinExists() in the LoadWait() function itself in the While loops. Is that correct?...not able to test it now. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 3, 2009 Share Posted February 3, 2009 So here is what my tests have shown. 1/ The problem happens either during navigate or loadwait2/ The winExists is not being seen in the loop because the function is not ending and going back to the loop.3/ This only happens when the DebugBar toolbar is open...even when the window is hidden.So I believe I would have to put the WinExists() in the LoadWait() function itself in the While loops. Is that correct?...not able to test it now.No. If the problem is blocking of the script then use the $f_wait = False option and so your script can continue while it loads/navigates the page. Do your own non-blocking check for "busy" with _IEPropertyGet() or maybe _IELoadWait($oIE, 0, 100), in the same loop you watch for the popup with. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Champak Posted February 7, 2009 Author Share Posted February 7, 2009 (edited) I don't know if this is what you meant, but this is what I did. I replaced the _IELoadWait() with a function call to the following: Func _LoadWait_ErrorTEST() _ConsoleWrite(">!!!!! LOAD WAIT") $Timeout = 0 Do Sleep(1000) $Timeout += 1 ;If WinExists("[CLASS:#32770; TITLE:Internet Explorer]") Then If WinExists("Internet Explorer", "Internet Explorer has encountered a problem and needs to close.") Then _ConsoleWrite("! IE Error Window Pop Up ===========================================") ControlClick("[CLASS:#32770]", "Internet Explorer has encountered a problem and needs to close.", 1001) EndIf $busy = _IEPropertyGet ( $oIE, "busy" ) ConsoleWrite("- busy loading: " & $busy & @CRLF) Until $busy = 0 Or $Timeout = 60 EndFunc If this is what you meant(or something like it), it doesn't work. It is getting stuck at the _IEPropertyGet() WHEN that pop up window shows up; and again, the window only pops up when the debugbar is open in the toolbar in IE. It seems the only way to fix this is to have a helper app look for this pop up window and close it so the main app can continue...or do you have another suggestion. Edited February 7, 2009 by Champak Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 7, 2009 Share Posted February 7, 2009 I don't know if this is what you meant, but this is what I did. I replaced the _IELoadWait() with a function call to the following: Func _LoadWait_ErrorTEST() _ConsoleWrite(">!!!!! LOAD WAIT") $Timeout = 0 Do Sleep(1000) $Timeout += 1 ;If WinExists("[CLASS:#32770; TITLE:Internet Explorer]") Then If WinExists("Internet Explorer", "Internet Explorer has encountered a problem and needs to close.") Then _ConsoleWrite("! IE Error Window Pop Up ===========================================") ControlClick("[CLASS:#32770]", "Internet Explorer has encountered a problem and needs to close.", 1001) EndIf $busy = _IEPropertyGet ( $oIE, "busy" ) ConsoleWrite("- busy loading: " & $busy & @CRLF) Until $busy = 0 Or $Timeout = 60 EndFunc If this is what you meant(or something like it), it doesn't work. It is getting stuck at the _IEPropertyGet() WHEN that pop up window shows up; and again, the window only pops up when the debugbar is open in the toolbar in IE. It seems the only way to fix this is to have a helper app look for this pop up window and close it so the main app can continue...or do you have another suggestion. I meant more like this (_IEPropertyGet() was probably a bad suggestion on my part): Func _LoadWait_ErrorTEST() _ConsoleWrite(">!!!!! LOAD WAIT" & @LF) $iTimer = TimerInit() While 1 Sleep(500) If WinExists("Internet Explorer", "Internet Explorer has encountered a problem and needs to close.") Then _ConsoleWrite("! IE Error Window Pop Up ====================================") ControlClick("[CLASS:#32770]", "Internet Explorer has encountered a problem and needs to close.", 1001) EndIf If _IELoadWait($oIE, 250, 250) Then ConsoleWrite("IE done loading: " & Round(TimerDiff($iTimer) / 1000) & "sec" & @LF) ElseIf TimerDiff($iTimer) >= 60000; 60sec timeout ConsoleWrite("60sec timeout expired!" & @LF) ExitLoop Else ConsoleWrite("IE busy loading: " & Round(TimerDiff($iTimer) / 1000) & "sec" & @LF) Else WEnd EndFunc ;==>_LoadWait_ErrorTEST This should check every 1sec for about 60secs. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Champak Posted February 10, 2009 Author Share Posted February 10, 2009 Nope. That's a no go as well . 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