Taek Posted May 7, 2009 Share Posted May 7, 2009 I'm really new to autoit, I mean i've only had it for a few hours. i'm attempting to make an application for some of my clients to retrieve data from the internet, now i have a connection ping test to make sure they have internet access, if the result from that ping is negative display some offline information. Is there some possiblity of loading an internal file from the apps exe or not?. here's my code below - anyhelp would be apreciated. expandcollapse popup#NoTrayIcon #include <GUIConstantsEx.au3> #include <IE.au3> #Region #EndRegion ; Main Window Variables Dim $WindowName = "VT Computer Services :: Online Mode" Dim $WindowFail = "VT Computer Services :: Offline Mode" Dim $width = "900" Dim $height = "600" Dim $HomePage = "http://www.some-domain.net/" Dim $iCon = "VTCServices.ico" ; ~~~~~~~~~~~~~~~~~~~~ $ping = Ping("google.com", 1000) If $ping = 0 then ; GUI Dim $gui = GUICreate($WindowName, $width, $height) Dim $IE = _IECreateEmbedded() GUICtrlCreateObj($IE, 0, 0, $width, $height) _IENavigate($IE, "index.html");Section I Would Like To Have Load Internal HTML File from Self EXE. GUISetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd Exit Else Dim $gui = GUICreate($WindowName, $width, $height) Dim $IE = _IECreateEmbedded() GUICtrlCreateObj($IE, 0, 0, $width, $height) _IENavigate($IE, $HomePage) GUISetState() EndIf While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Link to comment Share on other sites More sharing options...
blakel Posted May 7, 2009 Share Posted May 7, 2009 i don't understand the question. what would you like to load? Link to comment Share on other sites More sharing options...
Taek Posted May 7, 2009 Author Share Posted May 7, 2009 i don't understand the question. what would you like to load? Okay let me clarify myself a little bit better. I want to display a html file that is compiled into the binary and display it through a GUI. Partial Example Code #include "somefile.html" Dim $gui = GUICreate("SomeName", "WidthValue", "HeightValue") Dim $IE = _IECreateEmbedded() GUICtrlCreateObj($IE, 0, 0, "WidthValue", "HeightValue") _IENavigate($IE, "somefile.html") GUISetState() how can i get this Embeded IE to display the somefile.html that is compiled/included into the exe? Link to comment Share on other sites More sharing options...
Zedna Posted May 7, 2009 Share Posted May 7, 2009 Look at my resource UDFhttp://www.autoitscript.com/forum/index.php?showtopic=51103resource_test_ie.au3 - example script for using HTML resources with embeded IE COM object (without using UDF)#AutoIt3Wrapper_useupx=n #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, test_1.htm, 23, TEST_HTML_1, 0 #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, test_1.gif, 23, TEST_GIF_1, 0 #AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%" $oIE = ObjCreate("Shell.Explorer.2") $gui = GUICreate("HTML from resources example",500,400) $ie_ctrl = GUICtrlCreateObj ($oIE, 0, 0 , 500, 400) GUISetState(@SW_SHOW) ; image from resource (all HTML supported types) $oIE.navigate("res://" & @AutoItExe & "/test_gif_1") Sleep(3000) ; html from resource (with embeded image from resources) $oIE.navigate("res://" & @AutoItExe & "/test_html_1") While 1 If GUIGetMsg() = -3 Then Exit WEnd Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Taek Posted May 7, 2009 Author Share Posted May 7, 2009 Your Example Doesn't seem to work at all. I've tried several things but couldnt get it to work. Look at my resource UDF http://www.autoitscript.com/forum/index.php?showtopic=51103 resource_test_ie.au3 - example script for using HTML resources with embeded IE COM object (without using UDF) #AutoIt3Wrapper_useupx=n #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, test_1.htm, 23, TEST_HTML_1, 0 #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, test_1.gif, 23, TEST_GIF_1, 0 #AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%" $oIE = ObjCreate("Shell.Explorer.2") $gui = GUICreate("HTML from resources example",500,400) $ie_ctrl = GUICtrlCreateObj ($oIE, 0, 0 , 500, 400) GUISetState(@SW_SHOW) ; image from resource (all HTML supported types) $oIE.navigate("res://" & @AutoItExe & "/test_gif_1") Sleep(3000) ; html from resource (with embeded image from resources) $oIE.navigate("res://" & @AutoItExe & "/test_html_1") While 1 If GUIGetMsg() = -3 Then Exit WEnd Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now