Sign in to follow this  
Followers 0
Kachnik

GUI with html interpretor (Shell.Explorer.2 properties)

4 posts in this topic

Hello,

I have an array with html code which I need to display on gui.

I have find that there is a way with that I will make a html file od disk and than display it via

$oIE = ObjCreate("Shell.Explorer.2")

$oIE.navigate(c:\...

but it seems little bit unefective to me :)

I thing that there is somethning like $oIE.html which I can modify directly. but where to find these properties?

Or something completly different solution?

Thanks for tips!

Share this post


Link to post
Share on other sites



Hello,

I have an array with html code which I need to display on gui.

I have find that there is a way with that I will make a html file od disk and than display it via

$oIE = ObjCreate("Shell.Explorer.2")

$oIE.navigate(c:\...

but it seems little bit unefective to me :)

I thing that there is somethning like $oIE.html which I can modify directly. but where to find these properties?

Or something completly different solution?

Thanks for tips!

Read through the functions for IE Management in the help file. Look at _IECreateEmbedded(), _IEPropertyGet(), _IEDocWriteHTML() and almost any of the others. The URL portion of the $oIE.navigate line that you posted should also be quoted.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Thank you for pointing me to right direction!

With compilation of help scripts I made this:

$oIE = _IECreateEmbedded ()
    GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
    $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
    GUISetState()     ;Show GUI
    $sHTML = ""
    $sHTML &= "<html><head></head><body>" & @CR
    $sHTML &= "TEST" & @CR
    $sHTML &= "</body></html>" & @CR
    _IENavigate ($oIE, "")
    _IEDocWriteHTML ($oIE, $sHTML)
    _IEAction ($oIE, "refresh")

    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
            MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
            ExitLoop
        EndSelect
    WEnd
    GUIDelete()

I have two problems:

1)I have to open blank page and than modify it - which is only cosmetics.

2)It seems to me that my sample "TEST page" is loading forever, so I am not able to catch $GUI_EVENT_CLOSE and exits the gui

Thanks for tips

Share this post


Link to post
Share on other sites

This works fine on my system (messy because I didn't run Tidy)

#include<ie.au3>
#include<windowsconstants.au3>
#include<guiconstants.au3>
$oIE = _IECreateEmbedded ()
    GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        BitOR($WS_OVERLAPPEDWINDOW, $WS_VISIBLE, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
    $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
   ;GUISetState()    ;Show GUI
    $sHTML = ""
    $sHTML &= "<html><head></head><body>" & @CR
    $sHTML &= "TEST" & @CR
    $sHTML &= "</body></html>" & @CR
    _IENavigate ($oIE, "about:blank")
    _IEDocWriteHTML ($oIE, $sHTML)
    _IEAction ($oIE, "refresh")
GUISetState()
    While 1
        $msg = GUIGetMsg()
        Switch $Msg
            Case $GUI_EVENT_CLOSE
            MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
            ExitLoop
        EndSwitch
    WEnd
    GUIDelete()
    Exit

I changed your Select to a Switch and I added a URL into the _IENavigate() call


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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