Modify

Opened 13 years ago

Closed 9 years ago

Last modified 9 years ago

#110 closed Bug (Rejected)

GUICtrlCreateObj controls do not correctly track focus.

Reported by: anonymous Owned by: Valik
Milestone: Component: AutoIt
Version: 3.2.10.0 Severity: None
Keywords: Cc:

Description

The problem is that when i use multiple webbrowser objects on my GUI, I can only seem to copy and paste into One of them. all other object can copy text to the clipboard with ctrl+c and cant paste with ctrl+v
I also noticed that once inside an input box within a website, I also cant use Backspace or my directional keys

This has been tested with XP SP2 with IE7 and XP SP1 with IE6

Steps.
1) Copy ANY text to the clipboard (from any other place)
2) Try and paste this text into the Google Search box. You will notice that it does not work
3) Try and paste it into the Yahoo search box. It WILL work
4) *You may also notice that when trying to paste it into the Google search box, it will be pasted into the Yahoo search box even tho the cursor was in the Google Search box*

5) Open a notepad.
6) Attempt to copy ANY text from the Google page and paste it into the Notepad. You will notice that it does not work
7) Attempt to copy any text from the Yahoo page and paste it into the notepad. It will work

8) Type some text into the Yahoo search box, and type some text into the Google searchbox
9) In the google searchbox, Press the {Backspace} key as if to delete what you typed in the Google searchbox. You will notice that even tho your cursor is in the google searchbox, the text will be deleted from the Yahoo searchbox

10) repeat step 8. In the google searchbox, Press the {Left Arrow} key 3 or 4 times. Press the {Backspace} key as if to delete what you typed in the Google searchbox. You will notice that the text is deleted from the Yahoo searchbox from the point where the cursor *Would have been* be if you pressed {Left Arrow} from within the Yahoo searchbox (You were clearly pressing the arrow key in the Google searchbox right!)

#include <GUIConstantsEx.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

*Quote from DaleHohm*
"I was noticing that the Cut-Paste did not consistently fail for me and I think I figued out why.

If I select text in the Google Windows and do c v it does not work. If I right-click and choose Copy and then paste into notepad it does work. What is happening is that the c is being delivered to the Yahoo control instead (you can prove this by selecting some text in the Yahoo control then selecting text in the Google control... c v will paste the text from the yahoo control).

What is happening is that c v and Backspace are all being delivered to the Yahoo control even when it appears taht the Google control has focus.

I think that this realization dramatically reduces the complexity of the problem description. Letters, Numbers and Enter keys get delivered to the Google control as expected, c v a Tab and probably others get delivered only to the Yahoo control.

I suggest it is time for you to take this information and submit it to the Bug Trac system. I tested in both production and beta with the same results."

Discussion on forums can be found at
http://www.autoitscript.com/forum/index.php?showtopic=62153&st=15

Attachments (1)

test code only5.au3 (727 bytes) - added by Starbug 13 years ago.
.AU3 file for the code posted above

Download all attachments as: .zip

Change History (10)

Changed 13 years ago by Starbug

.AU3 file for the code posted above

comment:1 Changed 12 years ago by DaleHohm@…

I think this problem is better characterized as an issue with multiple GUICtrlCreateObj controls and keystroke delivery.

Dale

comment:2 Changed 12 years ago by Jpm

  • Summary changed from ObjCreate("Shell.Explorer.2") and Copy/Paste to multiple GUICtrlCreateObj controls and keystroke delivery

comment:3 Changed 12 years ago by SpuddyMcSpud

Not sure if this sheds any light for you, but things like Google's Suggest also stop working when multiple IE objects are called from the same GUI.

In this example, the Google Suggest site is called from the second IE object, so when you start typing in the search textbox, it will correctly suggest words for you:

CODE
#include <GUIConstantsEx.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")
$IE2.navigate2("http://www.google.com/webhp?complete=1&hl=en")

While 1
Sleep(100)
WEnd

Func Form2Close()
Exit
EndFunc

In this second example, Google Suggest is called in the first IE object. Typing in the search field does not bring up the suggestions as it should.

CODE
#include <GUIConstantsEx.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/webhp?complete=1&hl=en")
$IE2.navigate2("http://www.google.com")

While 1
Sleep(100)
WEnd

Func Form2Close()
Exit
EndFunc

OS: WinXP SP2, IE7 and all the latest hotfixes
AutoIt: 3.2.10.0

Hopefully that may help!

cheers,
Spud

comment:4 Changed 12 years ago by Valik

  • Owner set to Valik
  • Severity set to None
  • Status changed from new to accepted

comment:5 Changed 11 years ago by Valik

  • Summary changed from multiple GUICtrlCreateObj controls and keystroke delivery to GUICtrlCreateObj controls do not correctly track focus.

comment:6 Changed 11 years ago by Starbug

Still happening with Version: 3.3.0.0 Production

comment:7 Changed 11 years ago by Valik

Thank you for confirming a bug I didn't fix is still occurring...

comment:8 Changed 9 years ago by Jon

  • Resolution set to Rejected
  • Status changed from accepted to closed

comment:9 Changed 9 years ago by anonymous

Still happening in 3.3.6.1 production has this been fixed in beta 3.3.7.10 ?

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Valik.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.