Sign in to follow this  
Followers 0
sandin

IE frame bug?

5 posts in this topic

How is it possible that IE frame suddenly turns on after I click on "HOME" button:

#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

    Local $oIE = _IECreateEmbedded()

    ; Create a simple GUI for our output
    GUICreate("Embedded Web control Test", 640, 580, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
    $GUIActiveX = GUICtrlCreateObj ($oIE, 20, 20, 500, 360)
    $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
    $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
    $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
    $GUI_Button_Stop = GUICtrlCreateButton("Stop", 330, 420, 100, 30)
    
    GUISetState()       ;Show GUI
    
    _IENavigate($oIE, "http://www.autoitscript.com") ;IE has no frame
    _IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false")
    
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $GUI_Button_Home
                $oIE.navigate("http://www.google.com") ;IE frame pops up
            Case $msg = $GUI_Button_Back
                $oIE.GoBack
            Case $msg = $GUI_Button_Forward
                $oIE.GoForward
            Case $msg = $GUI_Button_Stop
                $oIE.Stop
        EndSelect
    WEnd

GUIDelete()

Share this post


Link to post
Share on other sites



Please provide a more detailed description. This one doesn't do it form me and I shouldn't have to run your code just to understand what you are talking about.

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

Share this post


Link to post
Share on other sites

Look here for good discussion and probable solution: http://www.autoitscript.com/forum/index.ph...316&hl=edge

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

Share this post


Link to post
Share on other sites

tnx for the link Dale, I tried the script on which Ivan replied as a succes. He said:

Thanks for the tips you Genius!!!!!!!! :)

Setting the border attribute of the body element to 0 worked perfectly! I thought it had to do with the gui control, as other controls have style settings.

Below is the modified $style for the above gui. I split the var so that it is more readable, adding the border attribute with a 0 px value.

and as you can see bellow, border is set to be 0px, but I still have edge on IE object, and so does Ivan's script:

#include <GuiConstantsex.au3>; Gui
#include <WindowsConstants.au3>
#include <IE.au3>; hypertext style support

$style='body {'
$style &= 'background: FEF9C4;'
$style &= 'font-family: sans-serif;'
$style &= 'font: normal sans-serif;'
$style &= 'font-size: small;'
$style &= 'scrollbar-3dlight-color: White;'
$style &= 'scrollbar-arrow-color: #660000;'
$style &= 'scrollbar-base-color: #F8DDBC;'
$style &= 'scrollbar-shadow-color: #462300;'
$style &= 'scrollbar-track-color: #DDD9DA;'
$style &= 'scrollbar-darkshadow-color: Black;'
$style &= 'scrollbar-highlight-color: FEF9C4;'
$style &= 'scrollbar-face-color: #F6931E;'
$style &= 'border: 0px;'
$style &= '}'

$html='<html>' & @CR & '<head>' & @CR & '<style type="text/css">' &$style &'</style>' & @CR & '</head>' & @CR & '<body oncontextmenu="return false">' & @CR & '</body>' & @CR & '</html>'

   $HtmlFileHndl = FileOpen('blank.html', 2)
   FileWriteLine($HtmlFileHndl, $html)
   FileClose($HtmlFileHndl)

$NiuGui = GUICreate("Niu", 600, 600, (@DesktopWidth / 2) - (800 / 2) , (@DesktopHeight / 2) - (600 / 2), $WS_POPUP+$WS_CLIPCHILDREN+$WS_CLIPSIBLINGS)
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
GUISetBkColor(0xFEF9C4, $NiuGui)
;~ _GuiRoundCorners($NiuGui, 0, 0, 150, 150)
$GUIActiveX = GUICtrlCreateObj($oIE, 25, 250, 550, 150)
GUISetState()
_IENavigate ($oIE, "www.google.com")
While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case Else
   EndSelect
WEnd

exit

Share this post


Link to post
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
Sign in to follow this  
Followers 0