ivan Posted July 17, 2006 Share Posted July 17, 2006 (edited) Run out of ideas I've been trying to no avail to disable the context menu functionality of an embedded Internet Explorer at the start of a script and return the functionality back to normal before exiting the script.As far as my brain can handle at the mo, the Context menu can be called via secondary mouse clicks or through the menu keyboard button. I don't ven know what it's called.The only half decent idea I've got worth mentioning was as follows:1) change my entire script to GUISetOnEvent mode2) if the secondary mouse button was clicked, repeatedly send an escape keystroke controled by a timer.That still leaves out the possibility of pressing the menu button on the keyboard, which I'm not that concerned about.The other attempt I made was a straight no no. I tried replacing the browser's context menu by anything else, such as_IEErrorHandlerRegister () $oIE = _IECreateEmbedded ();; bla bla create the gui$GUIActiveX = GUICtrlCreateObj($oIE, 25, 250, 550, 150)$buttoncontext = GUICtrlCreateContextMenu($GUIActiveX)$buttonitem = GUICtrlCreateMenuitem("About button", $buttoncontext)As I expected, that didn't work.Any better thought would be greatly appreciated.THANKSIVAN Edited July 17, 2006 by ivan Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
ivan Posted July 17, 2006 Author Share Posted July 17, 2006 I think I was on the wrong track altogether. Forgive me for answering my own question, but leaving this thread as is might provide clues to others. The solution is a lot simpler. Modify the the body tag of the document inserting oncontextmenu="return false" that's all there is to it. 1) Read the hypertext with _IEBodyReadHTML(ByRef $o_object) 2) modify the body tab adding oncontextmenu="return false" 3) Rewrite the body tag with _IEBodyWriteHTML(ByRef $o_object, $s_html) IVAN Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
DaleHohm Posted July 17, 2006 Share Posted July 17, 2006 I think I was on the wrong track altogether. Forgive me for answering my own question, but leaving this thread as is might provide clues to others.The solution is a lot simpler. Modify the the body tag of the document inserting oncontextmenu="return false"that's all there is to it.1) Read the hypertext with _IEBodyReadHTML(ByRef $o_object)2) modify the body tab adding oncontextmenu="return false"3) Rewrite the body tag with _IEBodyWriteHTML(ByRef $o_object, $s_html)IVANOr, look at the examle for the function _IEHeadInsertEventScript that does exactly what you want Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
ivan Posted July 23, 2006 Author Share Posted July 23, 2006 Sorry Dale, never checked for answers to this, let alone being polite and thanking you. IVAN Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 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