Jump to content

Problems with _IECreateEmbedded & copy/paste


Starbug
 Share

Recommended Posts

Hi!

i searched the fourms yesterday but found nothing to help me. Hopefully somebody here has the answer or can point me to somewhere that can help

The problem is that when i use multiple webbrowser objects on my GUI in different TABS, i can only seem to copy and paste into the last object that was created. all other object cant copy text to the clipboard with ctrl+c and cant paste with ctrl+v

I also noticed that once inside an input box, i also cant use Backspace or my directional keys

Sometimes i have noticed that when trying to paste into one of the previous TABS, the text will be pasted into the Last object created. very strange to see as i end up with everything im trying to paste into the wrong browser object

I noticed this issue while doing a larger project, but i have re-created the problem in the below small script. Hopefull somebody can help me.

Thanks in advance to anybody that can help.

Craig

#include <GUIConstants.au3>
#include <ie.au3>
$IE_1 = _IECreateEmbedded()
$IE_2 = _IECreateEmbedded()
$IE_3 = _IECreateEmbedded()
$IE_4 = _IECreateEmbedded()

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Tab1 = GUICtrlCreateTab(8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$IE_1_GUI = GUICtrlCreateObj($IE_1, 16, 72, 604, 364)
$Button1 = GUICtrlCreateButton("Button1", 312, 40, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Buttonclick")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$IE_2_GUI = GUICtrlCreateObj($IE_2, 16, 72, 604, 364)
$Button2 = GUICtrlCreateButton("Button2", 336, 40, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Buttonclick")
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
$IE_3_GUI = GUICtrlCreateObj($IE_3, 16, 72, 596, 356)
$Button3 = GUICtrlCreateButton("Button3", 320, 40, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Buttonclick")
$TabSheet4 = GUICtrlCreateTabItem("TabSheet4")
GUICtrlSetState(-1,$GUI_SHOW)
$IE_4_GUI = GUICtrlCreateObj($IE_4, 16, 72, 604, 364)
$Button4 = GUICtrlCreateButton("Button4", 336, 40, 75, 25, 0)
GUICtrlSetOnEvent($Button4, "Buttonclick")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Sleep(100)
WEnd

Func Buttonclick()
    If @GUI_CtrlId = $Button1 Then
        _IENavigate($IE_1, "http://www.google.com.au")
    ElseIf @GUI_CtrlId = $Button2 Then
        _IENavigate($IE_2, "http://au.yahoo.com/")
    ElseIf @GUI_CtrlId = $Button3 Then
        _IENavigate($IE_3, "http://www.ebay.com.au/")
    ElseIf @GUI_CtrlId = $Button4 Then
        _IENavigate($IE_4, "http://www.ign.com/")
    EndIf

MsgBox(0, "Debug", "Buttonclick")
EndFunc

Func Form1Close()
Exit
EndFunc

Func Tab1Change()
MsgBox(0, "Debug", "Tab1Change")
EndFunc
Link to comment
Share on other sites

The same issue can be done with the following code also.

You can then see clear as day, the data is pasted into the wrong webbrowser, and when using the backspace key, it is working in the wrong browser.

also note that you can copy and paste by using the right click method in all browser objects

#include <GUIConstants.au3>
#include <ie.au3>
$IE_1 = _IECreateEmbedded()
$IE_2 = _IECreateEmbedded()
$IE_3 = _IECreateEmbedded()
$IE_4 = _IECreateEmbedded()

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1061, 610, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("Button1", 24, 16, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Buttonclick")
$Button2 = GUICtrlCreateButton("Button2", 616, 16, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Buttonclick")
$Button3 = GUICtrlCreateButton("Button3", 24, 296, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Buttonclick")
$Button4 = GUICtrlCreateButton("Button4", 624, 296, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Buttonclick")
$IE_1_GUI = GUICtrlCreateObj($IE_1, 8, 56, 492, 236)
$IE_2_GUI = GUICtrlCreateObj($IE_2, 512, 56, 540, 236)
$IE_3_GUI = GUICtrlCreateObj($IE_3, 8, 328, 492, 276)
$IE_4_GUI = GUICtrlCreateObj($IE_4, 512, 328, 540, 276)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Sleep(100)
WEnd

Func Buttonclick()
    If @GUI_CtrlId = $Button1 Then
        _IENavigate($IE_1, "http://www.google.com.au")
    ElseIf @GUI_CtrlId = $Button2 Then
        _IENavigate($IE_2, "http://au.yahoo.com/")
    ElseIf @GUI_CtrlId = $Button3 Then
        _IENavigate($IE_3, "http://www.ebay.com.au/")
    ElseIf @GUI_CtrlId = $Button4 Then
        _IENavigate($IE_4, "http://www.ign.com/")
    EndIf

MsgBox(0, "Debug", "Buttonclick")
EndFunc


Func Form1Close()
Exit
EndFunc
Link to comment
Share on other sites

Can you please post very specific instructions on how to reproduce the problems? I do believe there are some bugs here, but I want to insure I understand exactly what you see.

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

Can you please post very specific instructions on how to reproduce the problems? I do believe there are some bugs here, but I want to insure I understand exactly what you see.

Dale

ok. as best as i can explain.

using the 2nd piece of code (pressing the buttons to navigate the web browser to the website)

if you copy anything to the clipboard (doesnt matter how) you will find that you cant paste this text into the 1st 3 Web browsers (google, yahoo, ebay)

for example, copy the word "Autoit" to the clipboard. you will find that yopu cant paste it into the search box on google, yahoo or ebay. if you right click, you can.

you will be able to paste it into the IGN search box, as its web browser was "embedded" into the GUI last. (if tested the order of this, and it confirms that the last one embedded will work fine)

further to this, after selecting the IGN search box, if you try and paste the text into the google search box for example, you will see that it gets pasted into the IGN screen (even tho the cursor was flashing in the google searchbox)

this also happens with the backspace and direction keys. pressing backspace in the google searchbox (for example)will start deleting things in the IGN searchbox, even tho clearly the cursor is in the google searchbox

i hope this is enough info to replicate my issue.

i am using autoit version v3.2.8.1 according to AutoIt.chm

ie.au3 Version: V2.3-1

<><><><>

EDIT

forgot to say about the copy.

you cant copy from any of the 1st 3 web browsers using ctrl+c.

right click method works for all browsers

Edited by Starbug
Link to comment
Share on other sites

Can you please post very specific instructions on how to reproduce the problems? I do believe there are some bugs here, but I want to insure I understand exactly what you see.

Dale

Hi,

I do not know if this helps, but I found that doing CTRL+C anv CTRL+V actions in embedded IE-s creates problems.

I almost went crazy to find the answer especially that things worked OK on my computer.

Finally we found that IE7 was on both machines which had problems. Mine has IE6.

In the first case, the CTRL+C in the embedded IE7 was ok, I could do next steps of my code.

However when returned and did another CTRL+V the code stopped for indefinite time. Sometimes 10 minutes later the embedded browser came back to live even when my exe was switched off by then...

More interesting that there was an internal workaround (do another shots of CTLR+C and CTLR+V) to use the same embedded IE for a period of time. Between 5-50 CTRL+C and CTRL+V events was possibled to do if the workaround was done in between.

I use _IEDocWriteHtml and _IEAction("refresh") only.

I also had a problem of having the backspace doing BACK event in the minimized embedded IE while typing in some AutoitGui's EditCtrl.

After they downgraded to IE6, the code flew again without the slightest problem.

I may be able to strip my code to give you a reproducer. Drop me a line if that would help. I wanted to post the above thing in Bugreport, but I did not test it around fully to be 100% sure if it is a bug.

Edited by Ármányos Kő
Link to comment
Share on other sites

Hi,

I do not know if this helps, but I found that doing CTRL+C anv CTRL+V actions in embedded IE-s creates problems.

I almost went crazy to find the answer especially that things worked OK on my computer.

Finally we found that IE7 was on both machines which had problems. Mine has IE6.

In the first case, the CTRL+C in the embedded IE7 was ok, I could do next steps of my code.

However when returned and did another CTRL+V the code stopped for indefinite time. Sometimes 10 minutes later the embedded browser came back to live even when my exe was switched off by then...

More interesting that there was an internal workaround (do another shots of CTLR+C and CTLR+V) to use the same embedded IE for a period of time. Between 5-50 CTRL+C and CTRL+V events was possibled to do if the workaround was done in between.

I use _IEDocWriteHtml and _IEAction("refresh") only.

I also had a problem of having the backspace doing BACK event in the minimized embedded IE while typing in some AutoitGui's EditCtrl.

After they downgraded to IE6, the code flew again without the slightest problem.

I may be able to strip my code to give you a reproducer. Drop me a line if that would help. I wanted to post the above thing in Bugreport, but I did not test it around fully to be 100% sure if it is a bug.

these PC's i use at work all have IE6

hope this is an easy fix :D

Link to comment
Share on other sites

These issues are not with IE.au3, but rather trouble with interaction os the browser control inside a GUI. As with any issue like this, the first step is getting a simple reproducer that demonstrates the issue very clearly and concisely.

I would like to challenge both of you to do this... what we need is the shortest, simplest code samples with click by click instructions that demonstrate each unique issue (@Starbug - your two examples are unique as one involves tabs and the other does not).

Once this is done and we've vetted them here, they can be entered into the bug trac system.

Thanks,

Dale

p.s. This will not be a "simple fix", but we are at a good place in the release cycle for potential bugs to be analyzed and fixed in the beta cycle. The core Devs are typically fantastic with fixes once the issues are clearly and unambiguously documented and reported.

Edited by DaleHohm

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

These issues are not with IE.au3, but rather trouble with interaction os the browser control inside a GUI. As with any issue like this, the first step is getting a simple reproducer that demonstrates the issue very clearly and concisely.

I would like to challenge both of you to do this... what we need is the shortest, simplest code samples with click by click instructions that demonstrate each unique issue (@Starbug - your two examples are unique as one involves tabs and the other does not).

Once this is done and we've vetted them here, they can be entered into the bug trac system.

Thanks,

Dale

p.s. This will not be a "simple fix", but we are at a good place in the release cycle for potential bugs to be analyzed and fixed in the beta cycle. The core Devs are typically fantastic with fixes once the issues are clearly and unambiguously documented and reported.

lets use the following code.

#include <GUIConstants.au3>
$IE1 = ObjCreate("Shell.Explorer.2")
$IE2 = ObjCreate("Shell.Explorer.2")

Opt("GUIOnEventMode", 1)
$Form2 = GUICreate("Form2", 908, 523, 195, 157)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form2Close")
$IE1_GUI = GUICtrlCreateObj($IE1, 8, 8, 452, 508)
$IE2_GUI = GUICtrlCreateObj($IE2, 464, 8, 436, 508)
GUISetState(@SW_SHOW)


$IE1.navigate2("http://www.google.com.au")
$IE2.navigate2("http://www.yahoo.com/")

While 1
    Sleep(100)
WEnd

Func Form2Close()
Exit
EndFuncoÝ÷ Ù+^¦ÍB¢5^ÆÛh¶*[¡ªÝ~º&j|¨¶«¦V{dëÉ©Ý¥«-zØb²×±¶)í¢Ø^ äj·!nX¢ì"Yè¶'¶­×hzÉè·
+tëÉ©Ý¥«-z+bÚ-æ,yªÜº1"Õ,¼(®N¢éÉ©l¢z-Ç­«péí¯(§Ú)^ا¶axj(W¬yªÜº1Ü"VÞ¥«-yا¶ay¡¢j·!n^½éíayË«²ðjȧ¶¢%y'­È[£N¥éÚ^¥§zÛ^m¡Ê)ÈXµìm~º&¶¢%z y©Ý¥«-z+bÚ-ãhµêZu.Â)ebqëajØ­v¬p¢¹;Û^m¡Ê)É©òµìm~º&¶j(¥¨jwijË^ا¶azz-z"Ü"(®Oʬ¢g­{bÚ-æ,yªÜº1jwmʬ¢g­{bÚ-ᨢ    ^±æ«rèÇÒ'¶ ¢%zÇ­È[£ëzË-àZrK)iǤ{&¬ûhué^µì!jܨºÜ©yا¶¢%zÇ­È[£(»¥z-Ç­«^½éí¨º·.®Ê+ȧ¶ ¢%zÇ­È[£az×±·¥·zW­y×ë¢kay¡¢j·!nuÒ·©y«lµê|"{az
(W¬yªÜº1>·¬²Ø^-çíºèÂG²Þø¶)°úÞ²ËaxÊZqéÉ«"~ÚzW­{Z·*.·*^v)íᨢ   ^±æ«rèÅ.Â)ebqëajÛaz×±¶+zW­y×ë¢kay¡¢j·!n_®­êh{pêÞ¶º»(­j.ØZ½æÞzvÞü¨ºÞ²Ç-çíºèÁúè­)íæ,yªÜº1b°z·æ«*kzË"ayªë£  Ê)íᨢ ^±æ«rèƸ Ý÷Ø-Ø-Ø-"¯yìiz¹×Â+a¶¬¦ºé××¥*.¶­Õ8^¢yrYæÛ®,zºç-¶­Âä±Ê+­ç-(¬¶¨ëajجªê-¶°«¨¶)íá"V¬µ.q©ízËm+Ê̦§Ø^¢·^®íí7è5B

I hope this is enough information to investigate this issue. If need be, can we move this post to the Bug section?

Link to comment
Share on other sites

It has been my experience that when you embed more than one IE window into a GUI, it makes the application unstable. I found IE would behave in a unpredictable manner, causing the application to crash, or even closing every IE window open. You can do searches using my handle and IE and you will see many post where I tried to crack this one and failed. I gave up on this one. If you can make this one stable, more power to you. I will be the first to congratulate you on your success.

Link to comment
Share on other sites

You'll need to specify your version of OS, AutoIt and IE. Steps 1-7 work for me with XP SP2, IE7 and AutoIt 3.2.10.0

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

For AutoIt version, look at the SciTe console output when you run your code.

In order to report a bug you *must* upgrade and test with the latest version of AutoIt, at this time it is 3.2.10.0

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

I have updated Autoit and replicated the problem.

must be something to do with IE6 or XP SP1

>"E:\autoit\SciTe\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "E:\BB LT Combined\test code only5.au3" /autoit3dir "E:\autoit\SciTe\.." /UserParams

+>14:46:48 Starting AutoIt3Wrapper v.1.9.3

>Running AU3Check (1.54.10.0) from:E:\autoit\SciTe\..

+>14:46:49 AU3Check ended.rc:0

>Running:(3.2.10.0):E:\autoit\SciTe\..\autoit3.exe "E:\BB LT Combined\test code only5.au3"

+>14:47:33 AutoIT3.exe ended.rc:0

+>14:47:35 AutoIt3Wrapper Finished

>Exit code: 0 Time: 46.988

Link to comment
Share on other sites

The BKSP piece still fails for me, just not the cut/paste. Perhaps someone else can test and post their results.

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

The BKSP piece still fails for me, just not the cut/paste. Perhaps someone else can test and post their results.

dale

i have tested this @home on my personal PC.

i have used the latest Autoit

my PC has XP SP2 and IE7.

fully updated as its a legit version

all of my previous problems were re-produced on this setup.

if there is any more info you need regarding my home PC or my Work PC, please let me know.

Craig

Link to comment
Share on other sites

  • 2 weeks later...

@Starbug

It was recenlty pointed out to me that there is a Remark in the helpfile for GUICtrlCreateObj that states:

'Document Objects' will only be visible if the Windows style $WS_CLIPCHILDREN has been used in GUICreate().

Please add that window style to your GUICreate call and report changes in behaviour.

thanks,

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

i have replicated this issue again on 1 PC. i will try it on a 2nd PC when i get home from work.

This was replicated using IE6. XP SP1

#include <GUIConstants.au3>
$IE1 = ObjCreate("Shell.Explorer.2")
$IE2 = ObjCreate("Shell.Explorer.2")

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 908, 523, 195, 157, BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_CLIPCHILDREN,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetOnEvent($GUI_EVENT_CLOSE, "Form2Close")
$IE1_GUI = GUICtrlCreateObj($IE1, 8, 8, 452, 508)
$IE2_GUI = GUICtrlCreateObj($IE2, 464, 8, 436, 508)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$IE1.navigate2("http://www.google.com.au")
$IE2.navigate2("http://www.yahoo.com/")

While 1
    Sleep(100)
WEnd

Func Form2Close()
Exit
EndFunc
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...