Quelle serait la meilleur solution svp?
► Afficher le texte
Code : Tout sélectionner
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=GpsToAdress.exe
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>
$url = @TempDir & "\earth.html"
_IEErrorHandlerRegister()
$ie = _IECreateEmbedded()
;CreateEarthHtml()
GUICreate("GpsToAdress", 800,600, 0, 0,$WS_OVERLAPPEDWINDOW)
$ieobject = GUICtrlCreateObj($ie, 4, 5, 794, 492)
GUISetState(@SW_SHOW)
_IENavigate($ie, $url, 0)
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
sleep(100)
Wend
Func CreateEarthHtml()
if FileExists(@TempDir&"\earth.html") then FileDelete(@TempDir&"\earth.html")
$sEarthHTML = FileOpen(@TempDir&"\earth.html", 1)
FileWrite($sEarthHTML,'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' &@CRLF& _
'<html xmlns="http://www.w3.org/1999/xhtml">' &@CRLF& _
'<head>' &@CRLF& _
' <title>Hertzsprung-Russell Diagram - Google Earth Plugin Sky-mode</title>' &@CRLF& _
' <meta http-equiv="content-type" content="text/html; charset=utf-8" />' &@CRLF& _
' <meta name="description" content="Interactive, browser-based Hertzsprung Russell diagram of 3000 nearby stars." />' &@CRLF& _
' <meta name="author" content="James Stafford" />' &@CRLF& _
' <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAPDUET0Qt7p2VcSk6JNU1sBSM5jMcmVqUpI7aqV44cW1cEECiThQYkcZUPRJn9vy_TWxWvuLoOfSFBw"></script>' &@CRLF& _
' <script type="text/javascript">' &@CRLF& _
'google.load("earth", "1", {"other_params": "sensor=false" });' &@CRLF& _
'var ge = null;' &@CRLF& _
'function init() {' &@CRLF& _
' google.earth.createInstance("map", initCB, failureCB);' &@CRLF& _
'}' &@CRLF& _
'function initCB(object) {' &@CRLF& _
' ge = object;' &@CRLF& _
' ge.getOptions().setMapType(ge.MAP_TYPE_SKY);' &@CRLF& _
' ge.getWindow().setVisibility(true);' &@CRLF& _
' ge.getOptions().setStatusBarVisibility(true);' &@CRLF& _
' ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);' &@CRLF& _
" google.earth.fetchKml(ge, 'http://www.barnabu.co.uk/files/kmz/hr_diagram_nl.kml', finished);" &@CRLF& _
'}' &@CRLF& _
'function failureCB(object) {' &@CRLF& _
' alert("load failed");' &@CRLF& _
'}' &@CRLF& _
'function finished(object) {' &@CRLF& _
' ge.getFeatures().appendChild(object);' &@CRLF& _
'}' &@CRLF& _
'</script>' &@CRLF& _
' <script type="text/javascript">' &@CRLF& _
' var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");' &@CRLF& _
' document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));' &@CRLF& _
' </script>' &@CRLF& _
' <script type="text/javascript">' &@CRLF& _
' try {' &@CRLF& _
' var pageTracker = _gat._getTracker("UA-2042313-1");' &@CRLF& _
' pageTracker._trackPageview();' &@CRLF& _
'} catch(err) {}</script>' &@CRLF& _
'</head>' &@CRLF& _
"<body onload='init()' id='body'>" &@CRLF& _
"<div id='map_container' style='height: 500px; width: 100%;'>" &@CRLF& _
"<div id='map' style='height: 100%;'></div>" &@CRLF& _
'</div>' &@CRLF& _
'</body>' &@CRLF& _
'</html>')
EndFunc
