Jump to content

Autoit display an offline html file into GUI


Renderer
 Share

Recommended Posts

Hello guys! I need your advice regarding this little problem:

I've tried to make AutoIT GUI display an onffline HTML file . I've used _IECreateEmbedded()  to do that but it did not worked! Does someone have an idea on how to make an AutoIT GUI render an offline HTML file?

I am waiting for your answers! Thanks in advance!

 

Link to comment
Share on other sites

Have a look to the example of the _IECreateEmbedded() function, then, in the _IENavigate() function,  just use the full path of your local html file instead the url, that is: change the "http://www.autoitscript.com" with "c:\temp\myfile.html" for example

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

it works well for me. I can open and view in a browser embedded in a GUI, any  html files located on the local HD without problems.

could you post your not working code?

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

it works well for me. I can open and view in a browser embedded in a GUI, any  html files located on the local HD without problems.

could you post your not working code?

i've got this message: 

 

Action canceled

Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable.
 

I'm more than sure that the code is correct. 

shot.bmp

Link to comment
Share on other sites

as jguinch say,

or you can also try with this:

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

Local $oIE = _IECreateEmbedded(), $msg, $sHtml_File
GUICreate("Embedded Web control Test", 640, 480, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUICtrlCreateObj($oIE, 10, 40, 600, 360)
Local $GUI_Button_Home = GUICtrlCreateButton("Coose a web page from disk", 10, 420, 600, 30)
GUISetState() ;Show GUI

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $GUI_Button_Home
            _IEAction($oIE, "stop")
            $sHtml_File = FileOpenDialog("Choose a web page from disk", @ScriptDir & "\", "html page (*.htm;*.html)")
            _IENavigate($oIE, $sHtml_File, 0)
    EndSelect
WEnd

GUIDelete()
Exit

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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