Jump to content

IE help needed - possible bug found. Need to confirm.


Recommended Posts

I have a script that will open a IE window inside of a GUI. I notice when I attempt to tab, it doesn't work. If I open the same webpage in IE, tab works fine.

???????? :rolleyes: ????????

Here is the code to show what is happening. Maybe it is my PC, but I need to make sure.

#include <GUIConstants.au3>
#include <IE.au3>
dim $h, $w, $title
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
$oIE2 = _IECreateEmbedded ()
$w = @DesktopWidth
$h = @DesktopHeight
$title = "Viewer"
GUICreate($title, $w - 40, $h - 60, 20 , "", $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 68, $w - 60, $h - 140)
GUICtrlSetResizing($GUIActiveX, 1)
$marquee = GUICtrlCreateObj($oIE2, 10, 39, $w - 60, 25)
GUICtrlSetResizing($marquee, 1)
_IENavigate($oIE2, "about:blank")
_IENavigate($oIE,"http://www.msn.com") ;  problem occures - Tab will not work in webpage. 

_IEDocWriteHTML ($oIE2, '<body scroll=no topmargin=0 BGCOLOR=LTGREEN><marquee SCROLLAMOUNT=2 >Things that can be placed here - Top problem board issues, announcements, alerts...</marquee></body>') 

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $GUI_EVENT_RESIZED  
            _ResizeLimit($Title, "",$w - 100, $h - 100, @DesktopWidth, @DesktopHeight)
    EndSelect
WEnd

Func _ResizeLimit($Title, $Text="", $MinWidth=150, $MinHeight=150, $MaxWidth=@DesktopWidth, $MaxHeight=@DesktopHeight)
    If Not WinExists($Title, $Text) Then Return SetError(1, 0, -1)
    Local $PosArr = WinGetPos($Title, $Text), $xPos, $yPos, $wPos, $hPos
    If IsArray($PosArr) Then
        $xPos = $PosArr[0]
        $yPos = $PosArr[1]
        $wPos = $PosArr[2]
        $hPos = $PosArr[3]
        If ($wPos <> $MinWidth And $hPos <> $MinHeight) Or ($wPos <> $MaxWidth And $hPos <> $MaxHeight) Then
            If $wPos < $MinWidth And $hPos < $MinHeight Then WinMove($Title, $Text, $xPos, $yPos, $MinWidth, $MinHeight)
            If $wPos < $MinWidth And $hPos >= $MinHeight Then WinMove($Title, $Text, $xPos, $yPos, $MinWidth, $hPos)   
            If $wPos >= $MinWidth And $hPos < $MinHeight Then WinMove($Title, $Text, $xPos, $yPos, $wPos, $MinHeight)
           
            If $wPos > $MaxWidth And $hPos > $MaxHeight Then WinMove($Title, $Text, $xPos, $yPos, $MaxWidth, $MaxHeight)
            If $wPos > $MaxWidth And $hPos <= $MaxHeight Then WinMove($Title, $Text, $xPos, $yPos, $MaxWidth, $hPos)   
            If $wPos <= $MaxWidth And $hPos > $MaxHeight Then WinMove($Title, $Text, $xPos, $yPos, $wPos, $MaxHeight)
        EndIf
    EndIf
EndFunc
Edited by Volly
Link to comment
Share on other sites

I have a script that will open a IE window inside of a GUI. I notice when I attempt to tab, it doesn't work. If I open the same webpage in IE, tab works fine.

???????? :rolleyes: ????????

Here is the code to show what is happening. Maybe it is my PC, but I need to make sure.

Ran it here (but pointed to www.google.com) and see the same. No Tab in the enbedded IE, tabs fine in regular IE.

XP Pro SP2, IE 6 SP2, AutoIt 3.2.4.9

:rambo:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I wonder what is going on there. Would this be considered a bug, or a error in my coding??? :rolleyes:

I have a good answer for that... Yo, Dale? Earth to Dale, are you there... :rambo:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I striped down the code to make it as basic as possible.

#include <GUIConstants.au3>
#include <IE.au3>
dim $h, $w, $title
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
$w = @DesktopWidth
$h = @DesktopHeight
$title = "Viewer"
GUICreate($title, $w - 40, $h - 60, 20 , "", $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 68, $w - 60, $h - 140)

_IENavigate($oIE,"http://www.autoitscript.com") ; same problem occures - Tab will not work. 
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEndoÝ÷ Ù8^±©¦ºé¬¶)e{¬´è¶'v0z÷«ò&jG­+,©er§ëazènW¦ÇâÅçZºÚ"µÍÚ[ÛYH   ÑÕRPÛÛÝ[Ë]LÉÝÂÚ[ÛYH  ÒQK]LÉÝÂ[H  ÌÍÚ  ÌÍÝË    ÌÍÝ]BÒQQÜ[YÚÝ

BÌÍÛÒQHHÒQPÜX]Q[XYY

BÌÍÝÈHÚÝÜÚYÌÍÚHÚÝÜZYÚÌÍÝ]HH   ][ÝÕY]Ù][ÝÂÕRPÜX]J   ÌÍÝ]K    ÌÍÝÈH
    ÌÍÚH
    ][ÝÉ][ÝË    ÌÍÕÔ×ÓÕTTQÒSÕÈ
È  ÌÍÕÔ×ÕTÒPH
È  ÌÍÕÔ×ÐÓTÒPSÔÊBÌÍÑÕRPXÝ]VHÕRPÝÜX]SØ   ÌÍÛÒQKL
    ÌÍÝÈH
    ÌÍÚHM
BÕRTÙ]Ý]J
BÒQS]YØ]J ÌÍÛÒQK  ][ÝÚËÝÝÝË]]Ú]ØÜÛÛI][ÝÊHÈØ[YHØ[HØØÝÈHXÚ[ÝÛÜËÚ[HB  ÌÍÛÙÈHÕRQÙ]ÙÊ
BÙ[XÝØÙH    ÌÍÛÙÈH ÌÍÑÕRWÑUSÐÓÔÑB^]ÛÜQ[Ù[XÝÑ[oÝ÷ Ø0×!yÛazÝzº¶¬jëh×6GUISetState()
_IENavigate($oIE,"http://www.autoitscript.com") ; same problem occures - Tab will not work.

If the GUISetState is BEFORE the _IENavigate, you can tab. If it is after, you can't. I also noticed if you do a mouseover on a hyperlink first with the "fix" the tab will work. It will not work until then. I suspect this is for the tab doesn't have a start point. Can someone else test this to confirm? If I'm right, would this be considered a bug?

Link to comment
Share on other sites

I spoke too soon. I noticed when I want to use the webpage I plan to use for my viewer, I still can't tab. My viewer has some buttons on it, and the tab wants only to interact with them. Even if I want to click on the control in the main window, then tab to the second control, it will not tab down. I can enter in text, but not switch between fields.

Edited by Volly
Link to comment
Share on other sites

In testing, I noticed something else. The logon screen I want to work with has 2 buttons. You notice the buttons have the ability to be pressed by the keyboard. In this case the logon button can be pressed by using Alt+L. Well, when I do that, the PC will just beep, as if saying "Nope, you can't do that". Thoughts?

Edit: in Normal IE window, you can do this....

Edited by Volly
Link to comment
Share on other sites

I've run into this before:

http://www.autoitscript.com/forum/index.php?showtopic=31539

http://www.autoitscript.com/forum/index.php?showtopic=32804

http://www.autoitscript.com/forum/index.php?showtopic=33627

The problem is that the embedded IE ActiveX control steals your accelerator keys (tab, backspace, etc). Because AutoIt only handles COM through IDispatch, and because the only way to intercept accelerator keys in the GUI when you're hosting the IE control is through IDocHostUIHandler, you're pretty much screwed. I've been informed that adding support for IDocHostUIHandler is no small thing, so don't expect a resolution on this, just find a way to work around the limitation that works for what you're trying to accomplish.

The links I've posted above do contain some workarounds, but they are far from perfect.

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

hmmm, In my testing, I also noticed other things, but I've been playing around with it. I wanted to have 2 windows, in that I wanted to run a marquee in one of them using a applet. I tried using a AutoIt solution to the scroll, but it is too choppy. I looked at your code on the duel thing. NICE! :rolleyes:

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...