Faut dire, le code autoit avec plein de belles couleurs c'est joli, seulement voila, vous avez un site et vous voulez afficher le code de votre joli programme, mais en noir, c'est pô bô.
Voici comment faire :
Sur notre beau forum autoit votre code est affiché ainsi :
Code : Tout sélectionner
#include <GuiConstants.au3>
#include <WinApi.au3>
#include <GdiPlus.au3>
Global $ahCallBack[2], $iPrecent
GUICtrlCreateLabel("", 9, 9, 302, 22, -1, $WS_EX_STATICEDGE)
$hGraphic2 = _GDIPlus_ImageGetGraphicsContext($hBitMap)
$Depth = 1.64 ; Min = 1.10 Max = 1.70
msgbox(0,"System Uptime","Days: "&$iDays& ", Hours: "&$iHours &", Minutes: "&$iMins & ", Seconds: "&$iSecs )
(Le code veut absolument rien dire, j'ai juste essayé de reprendre un max de couleur
)
Ensuite vous cliquez sur la barre de votre navigateur internet:
affichage -> source ou
affichage -> code source de la page
Le code html de la page apparait, a vous de retrouvez la ligne du début du code autoit. Le plus facile est de faire
edition -> rechercher et de taper
Code:
A vous de copy past le code ce qui donnera pour mon code ceci:
► Afficher le textele code html
Code : Tout sélectionner
<span style="color: #F000FF; font-style: italic;">#include</span> <GuiConstants.<span style="color: #0000FF; font-style: italic; font-weight: bold;">au3</span>><br /><span style="color: #F000FF; font-style: italic;">#include</span> <WinApi.<span style="color: #0000FF; font-style: italic; font-weight: bold;">au3</span>><br /><span style="color: #F000FF; font-style: italic;">#include</span> <GdiPlus.<span style="color: #0000FF; font-style: italic; font-weight: bold;">au3</span>><br /><a href="http://www.autoitscript.fr/autoit3/docs/keywords.htm"><span style="color: #0000FF; font-weight: bold;">Global</span></a> <span style="font-weight: bold; color: #AA0000;">$ahCallBack</span><span style="color: #FF0000; font-weight: bold;">[</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">2</span><span style="color: #FF0000; font-weight: bold;">]</span>, <span style="font-weight: bold; color: #AA0000;">$iPrecent</span><br /><a href="http://www.autoitscript.fr/autoit3/docs/functions/GUICtrlCreateLabel.htm"><span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateLabel</span></a><span style="color: #FF0000; font-weight: bold;">(</span><span style="font-weight: bold; color: #008080;">""</span>, <span style="color: #AC00A9; font-style: italic; font-weight: bold;">9</span>, <span style="color: #AC00A9; font-style: italic; font-weight: bold;">9</span>, <span style="color: #AC00A9; font-style: italic; font-weight: bold;">302</span>, <span style="color: #AC00A9; font-style: italic; font-weight: bold;">22</span>, <span style="color: #AC00A9; font-style: italic; font-weight: bold;">-1</span>, <span style="font-weight: bold; color: #AA0000;">$WS_EX_STATICEDGE</span><span style="color: #FF0000; font-weight: bold;">)</span><br /><span style="font-weight: bold; color: #AA0000;">$hGraphic2</span> = <span style="color: #0080FF; font-style: italic; font-weight: bold;">_GDIPlus_ImageGetGraphicsContext</span><span style="color: #FF0000; font-weight: bold;">(</span><span style="font-weight: bold; color: #AA0000;">$hBitMap</span><span style="color: #FF0000; font-weight: bold;">)</span><br /><span style="font-weight: bold; color: #AA0000;">$Depth</span> = <span style="color: #AC00A9; font-style: italic; font-weight: bold;">1.64</span> <span style="font-style: italic; color: #009933;">; Min = 1.10 Max = 1.70</span><br /><a href="http://www.autoitscript.fr/autoit3/docs/functions/MsgBox.htm"><span style="color: #000080; font-style: italic; font-weight: bold;">msgbox</span></a><span style="color: #FF0000; font-weight: bold;">(</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span>,<span style="font-weight: bold; color: #008080;">"System Uptime"</span>,<span style="font-weight: bold; color: #008080;">"Days: "</span>&<span style="font-weight: bold; color: #AA0000;">$iDays</span>& <span style="font-weight: bold; color: #008080;">", Hours: "</span>&<span style="font-weight: bold; color: #AA0000;">$iHours</span> &<span style="font-weight: bold; color: #008080;">", Minutes: "</span>&<span style="font-weight: bold; color: #AA0000;">$iMins</span> & <span style="font-weight: bold; color: #008080;">", Seconds: "</span>&<span style="font-weight: bold; color: #AA0000;">$iSecs</span> <span style="color: #FF0000; font-weight: bold;">)</span><br />
Et mettez le dans votre page html. Toutefois quelques réglages s'impose. Je vous donne donc directement les réglages css à executer pour un texte uniforme pour les deux navigateurs:
Code : Tout sélectionner
<HTML>
<HEAD>
<STYLE type="text/css">
<!--
A { text-decoration: none }
body {font-size: 100%}
-->
</STYLE>
<!--[if IE]>
<STYLE type="text/css">
A { text-decoration: none }
body {font-size: 80%}
</STYLE>
<![endif]-->
</HEAD>
<BODY>
<div class="autoit" id="cb88015" style="font-family: monospace;">
LE CODE HTML ICI
</div>
</BODY>
</HTML>
Ce qui vous donnera tout simplement ceci:
Si vous voulez un cadre comme sur le forum, voici le fichier html à avoir:
► Afficher le textedu code html
Code : Tout sélectionner
<HTML>
<HEAD>
<STYLE type="text/css">
<!--
A { text-decoration: none }
body {font-size: 100%}
.quotetitle {
margin: 10px 5px 0 5px;
padding: 4px;
border-width: 1px 1px 0 1px;
border-style: solid;
border-color: #d8f0fa;
color: #333333;
background-color: #eff9fe;
font-size: 1.0em;
font-weight: bold;}
.quotecontent {
margin: 0 5px 10px 5px;
padding: 5px;
border-color: #d8f0fa;
border-width: 0 1px 1px 1px;
border-style: solid;
font-weight: normal;
font-size: 1.1em;
line-height: 1.4em;
font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
background-color: #eff9fe;
color: #00324c; }
.quotetitle{
font-size: 1.0em;
}
-->
</STYLE>
<!--[if IE]>
<STYLE type="text/css">
A { text-decoration: none }
body {font-size: 80%}
.quotetitle {
margin: 10px 5px 0 5px;
padding: 4px;
border-width: 1px 1px 0 1px;
border-style: solid;
border-color: #d8f0fa;
color: #333333;
background-color: #eff9fe;
font-size: 1.0em;
font-weight: bold;
}
.quotetitle {
font-size: 1.0em;
}
.quotecontent {
margin: 0 5px 10px 5px;
padding: 5px;
border-color: #d8f0fa;
border-width: 0 1px 1px 1px;
border-style: solid;
font-weight: normal;
font-size: 1.1em;
line-height: 1.4em;
font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
background-color: #eff9fe;
color: #00324c; }
</STYLE>
<![endif]-->
</HEAD>
<BODY>
<div class="autoit" id="cb88015" style="font-family: monospace;">
<div class="quotetitle"><b>Code autoit</b></div><div class="quotecontent">
CODE HTML ICI
</div>
</div>
</BODY>
</HTML>
Ce qui vous donnera:
Et voilà
Des questions ou suggestions, n'hésitez pas.
Tutorial réalisé par Jbnh <hardwarez@hotmail.co.uk>