HeidiR Posted July 28, 2008 Share Posted July 28, 2008 In the script below, I am opening an html file in an enbedded IE object (UDF) and selecting all text in the object and copyiing to the clipboard. Unfortunately, the select all and copy does not work because the ControlFocus function (line #22 below) is failing. Actually, the ControlFocus return code = 1, which indicates success, but the control does NOT have focus. The ControlGetFocus (line #23 below) shows button1 having the focus. What am I missing??? #include <ie.au3> Opt("GuiOnEventMode", 1) Global $oIE, $Button1 GUICreate("Embedded IE", 600, 400) GUISetOnEvent(-3, "quit") $oIE = _IECreateEmbedded() GUICtrlCreateObj($oIE, 10, 10, 580, 340) $Button1 = GUICtrlCreateButton("Open", 125, 360, 100, 30) GUICtrlSetOnEvent(-1, "go") _IENavigate($oIE, "about:blank", 0) GUISetState() While 1 Sleep(1000) WEnd Func go() _IENavigate($oIE, "label.html", 0) msgbox(0,"ControlFocus", ControlFocus ("Embedded IE", "", $oIE)) msgbox(0,"ControlGetFocus", ControlGetFocus ("Embedded IE")) send("^a") ;Select all send("^c") ;Copy EndFunc Func quit() Exit EndFunc HeidiRFind free applications, code examples and more on my site at:http://heidisdownloads.com/ Link to comment Share on other sites More sharing options...
billthecreator Posted July 28, 2008 Share Posted July 28, 2008 $sHTML = _IEBodyReadText ($oIE) ClipPut($sHTML) [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
HeidiR Posted July 28, 2008 Author Share Posted July 28, 2008 Thanks for the information. ClipPut(_IEBodyReadText ($oIE)) worked perfectly!!! HeidiRFind free applications, code examples and more on my site at:http://heidisdownloads.com/ 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