Manioums Posted July 11, 2015 Share Posted July 11, 2015 Hello !I'm having some problems with _IECreateEmbedded() + $oIE.document.write + ObjEventHere's my code :expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> Local $oIE = _IECreateEmbedded() $hGUI = GUICreate("test", 220, 150, (@DesktopWidth - 720) / 2, (@DesktopHeight - 650) / 2) GUISetState(@SW_SHOW, $hGUI) GUICtrlCreateObj($oIE, 0, 0, 220, 150) $oIE.navigate("about:blank") $oIE.document.write("<html><head></head>" & _ "<body style='border:0;margin:0px'><button id='macro2'>MACRO 2</button>" & _ "<br>lorem ipsum<br><br>lorem ipsum<br><br>lorem ipsum<br><br>lorem ipsum<br><br>lorem ipsum<br></body></html>") $oIE.refresh $oIE.document.body.scroll = "no" $oB2 = _IEGetObjByID($oIE, "macro2") ConsoleWrite(ObjName($oB2) & @CRLF) ConsoleWrite(ObjName($oB2, 4) & @CRLF) ; File with Interface defs ConsoleWrite(ObjName($oB2, 6) & @CRLF) ; CLSID of the object's coclass ObjEvent($oB2, "_MY_EVENT_HANDLER_") Func _MY_EVENT_HANDLER_onclick($oEvtObj) ConsoleWrite("!!!!!CLICKED THE BUTTON" & @CRLF) MsgBox(4096, "Yay John!", "You clicked the button.") EndFunc While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndWhen i click on the "MACRO 2" button there is nothing happening and i cant' figure why I need to use $oIE.document.write because I need don't want to have a browser scroll.Thanks a lot for your help ! Link to comment Share on other sites More sharing options...
mikell Posted July 11, 2015 Share Posted July 11, 2015 Func _MY_EVENT_HANDLER_onclick() ; <<<<< ConsoleWrite("!!!!!CLICKED THE BUTTON" & @CRLF) MsgBox(4096, "Yay John!", "You clicked the button.") EndFunc Link to comment Share on other sites More sharing options...
Manioums Posted July 11, 2015 Author Share Posted July 11, 2015 Hi mikell,Thank you for your answer but it's not working either.If I do :ObjEvent($oIE.document, "_MY_EVENT_HANDLER_")That's working but obviously the all page is answering to the _onclick event and i want just the button.ObjEvent($oIE.document.getElementById("macro2"), "_MY_EVENT_HANDLER_")That's not working and i don't know why Thank you for your help ! Link to comment Share on other sites More sharing options...
lutzxs Posted July 11, 2015 Share Posted July 11, 2015 Hi mikell,Thank you for your answer but it's not working either.If I do :ObjEvent($oIE.document, "_MY_EVENT_HANDLER_")That's working but obviously the all page is answering to the _onclick event and i want just the button.ObjEvent($oIE.document.getElementById("macro2"), "_MY_EVENT_HANDLER_")That's not working and i don't know why Thank you for your help ! Is that what should happen? Link to comment Share on other sites More sharing options...
mikell Posted July 11, 2015 Share Posted July 11, 2015 (edited) Hmm your code works nice for me (on 3.3.12.0 and the latest 3.3.14.0)Is it still not working with IE not embedded ? Edited July 11, 2015 by mikell Link to comment Share on other sites More sharing options...
lutzxs Posted July 11, 2015 Share Posted July 11, 2015 (edited) Hmm your code works nice for me (on 3.3.12.0 and the latest 3.3.14.0)The same for me i dont know whats the problem Edited July 11, 2015 by lutzxs Link to comment Share on other sites More sharing options...
Manioums Posted July 11, 2015 Author Share Posted July 11, 2015 Thank a lot for your answer.I'm under Win 8.1 + 3.3.12.0 build.When i doing "Go" (F5) (SciTE 3.4.4) from the menu it's not working. I've checked with the .exe and it's working fine !I've update to SciTE 3.4.5 and no change with Go or F5. i'm relief that the exe is working, but it's normal to have this difference ?Thank you again, Link to comment Share on other sites More sharing options...
Manioums Posted July 11, 2015 Author Share Posted July 11, 2015 (edited) Ok the problem was generated by a class i used before : https://www.autoitscript.com/forum/topic/163492-ie-embedded-control-versioning-use-ie9-and-html5-in-a-gui/I fixed it with : https://www.autoitscript.com/forum/topic/163542-objevent-dont-work/Thanks again for your help ! Edited July 11, 2015 by Manioums 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