hagaizenberg Posted October 28, 2009 Share Posted October 28, 2009 Hi all, I've encountered a strange problem that when i right-click an item on IE and the small menu pops up, my entire script is stuck until i close the pop-up menu. It's a bit hard to explain so it's best to give u a script that demonstrates this. This get stuck on line 18 = MouseClick("right",259,206) When I release the pop-up menu, the scripts continues. Just run this, and see how it get stuck (check the console for the messages). Any one has an idea why this happens???? This doesn't happen when I use IE not embedded... #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> $screensizeX=800 $screensizeY=500 _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () GUICreate("test", $screensizeX, $screensizeY, _ 1,1, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 10, $screensizeX-25, $screensizeY-25) GUISetState() ;Show GUI _IENavigate($oIE, "http://rendezvous-info.com/galleries/bardo-drums-hagai-itai-60.jpg") _IELoadWait ($oIE) ConsoleWrite("before right click"&@CRLF) MouseClick("right",259,206) ConsoleWrite("after right click"&@CRLF) ConsoleWrite("before left click"&@CRLF) MouseClick("left",361,326) ConsoleWrite("after left click"&@CRLF) ; Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Link to comment Share on other sites More sharing options...
Authenticity Posted October 28, 2009 Share Posted October 28, 2009 Yeah, the problem with embedded IE control is that any blocking dialog box like the alert() is making your script to be blocked. It's like your script is indirectly calling MsgBox() which is also a blocking routine. I don't know a workaround from the same script (even using timers). You can however execute another script before you preform the blocking action to wait for the dialog and close it so your first script can continue to execute. Link to comment Share on other sites More sharing options...
hagaizenberg Posted October 29, 2009 Author Share Posted October 29, 2009 (edited) 10x for the reply.that's really upsetting...! my script is complicated enough without having to run another script to release the jammed script :-)isn't that considered a bug in autoit?anyway, i thought about trying this instead of the autoit mouseclick: DllCall($user32, "int", "SendMessage", "hwnd", $handle, "int", $ButtonUp, "int", $Button, "long", _MakeLong($X, $Y))u think it'll work?i saw that the script it stuck on the mouse-up so i'll try to do it externally.i'll give it a try and update you.Yeah, the problem with embedded IE control is that any blocking dialog box like the alert() is making your script to be blocked. It's like your script is indirectly calling MsgBox() which is also a blocking routine. I don't know a workaround from the same script (even using timers). You can however execute another script before you preform the blocking action to wait for the dialog and close it so your first script can continue to execute. Edited October 29, 2009 by hagaizenberg Link to comment Share on other sites More sharing options...
bo8ster Posted October 29, 2009 Share Posted October 29, 2009 Sounds like a DaleHohm question. All I can suggest is using #AutoIt3Wrapper_run_debug_mode=Y "it's magic" Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] 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