Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=Data\icon.ico
- #AutoIt3Wrapper_UseX64=n
- #AutoIt3Wrapper_Res_Comment=Achievement get ! Fouiner dans les ressources du wrapper. Je n y ai rien mis de spécial, te tracasse pas.
- #AutoIt3Wrapper_Res_Description=Launcher Minecraft.fr
- #AutoIt3Wrapper_Res_Fileversion=0.1.0.15
- #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
- #AutoIt3Wrapper_Res_Language=1036
- #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
- #AutoIt3Wrapper_Run_Tidy=y
- #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
- ;~ #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <IE.au3>
- #include <gdiplus.au3>
- #include <Misc.au3>
- #include <String.au3>
- #include <aaa.au3>
- #include <7zip.au3>
- #include <_InetGetX.au3>
- #cs
- A faire :
- Le launcher officiel ne clique pas sur login automatiquement (Résolu ?)
- Le launcher officiel ne disparait pas
- Ca fait "ting ting ting" quand on clique sur minecraft.fr
- Adresses de téléchargement :
- /newsFeed.php
- /Minecraft_font.ttf
- /Minecraft_Mods.zip
- /version.htm
- /Minecraft.fr.zip
- /log.php <action>
- #ce
- Local $sString
- $counter = 1
- $exitcode = False
- $existed = False
- $F1Width = 800
- $F1Height = 311
- $df = @ScriptDir & "\Data\"
- $minecraftdir = @AppDataDir & "\.minecraft"
- $registry = "HKCU\SOFTWARE\Minecraft"
- $checkerdir = "Checker.exe"
- $ftp = "http://serveurmcfr.mtxserv.fr"
- $justFtpDir = "/Launcher/Dependances%20launcher"
- $ftpDir = $ftp & $justFtpDir
- $DebugCons = 0
- If _Singleton(@ScriptName) = 0 Then
- Exit
- EndIf
- While 1
- If WinExists("Minecraft Launcher") Then
- ProcessClose(WinGetProcess("Minecraft Launcher"))
- Else
- ExitLoop
- EndIf
- WEnd
- ;GUI de débug
- $FDebug = GUICreate("Console testeur", 500, 300, (@DesktopWidth / 2) + ($F1Width / 2) + 5, (@DesktopHeight / 2) - ($F1Height / 2), $WS_BORDER)
- $DebugCons = GUICtrlCreateEdit("", 0, 0, 500, 300, $ES_READONLY)
- While ProcessExists("Checker.exe")
- ProcessClose("Checker.exe")
- Debug("Fermeture du/des Checker.exe.")
- WEnd
- $ping = Ping("www.google.fr")
- If @ScriptName = "Src.au3" Or @ScriptName = "Src.exe" Then
- $debugMode = True
- GUISetState(@SW_SHOW, $FDebug)
- Else
- $debugMode = False
- GUISetState(@SW_HIDE, $FDebug)
- EndIf
- If FileExists("C:\Windows\Fonts\Minecraft normal.ttf") = 0 Or FileExists("C:\Windows\Fonts\BRLNSR.TTF") = 0 Then
- Debug("Polices d'écriture non installées.")
- If RegRead($registry, "FontEnabled") = 1 Or RegRead($registry, "FontEnabled") = "" Then
- $temp = MsgBox(4, "Launcher Minecraft.fr", "Il semble que vous ne possédez pas les polices d'écritures requises. Voulez-vous les installer ?")
- If $temp = 6 Then
- InetGet($ftpDir & "/Minecraft_font.ttf", "Minecraft normal.ttf", 1)
- ShellExecute("Minecraft normal.ttf")
- $hNews = InetGet($ftpDir & "/BRLNSR.TTF", "BRLNSR.TTF", 1)
- ShellExecute("BRLNSR.TTF")
- While ProcessExists("fontview.exe")
- WEnd
- FileDelete("Minecraft normal.ttf")
- FileDelete("BRLNSR.TTF")
- RegWrite($registry, "FontEnabled", "REG_DWORD", Hex(1))
- Else
- RegWrite($registry, "FontEnabled", "REG_DWORD", Hex(0))
- EndIf
- EndIf
- ElseIf FileExists("C:\Windows\Fonts\Minecraft normal.ttf") = 1 And FileExists("C:\Windows\Fonts\BRLNSR.TTF") = 1 Then
- RegWrite($registry, "FontEnabled", "REG_DWORD", Hex(1))
- EndIf
- ;Mise au clair : Est-ce qu'on utilise une police custom ou pas ?
- If RegRead($registry, "FontEnabled") = 1 Then $policesOk = True
- If RegRead($registry, "FontEnabled") = 0 Then $policesOk = False
- ;GUI de mise à jour
- $g2_height = 138
- $g2_width = 286
- $F2 = GUICreate("Mise à jour", $g2_width, $g2_height, (@DesktopWidth / 2) - ($g2_width / 2), (@DesktopHeight / 2) - ($g2_height / 2))
- GUICtrlCreateLabel("Votre version du jeu n'est pas à jour.", ($g2_width / 2) - ((StringLen("Votre version du jeu n'est pas à jour.") * 4.6) / 2), 16)
- GUICtrlCreateLabel("Veuillez patienter le temps de sa mise à niveau.", ($g2_width / 2) - ((StringLen("Veuillez patienter le temps de sa mise à niveau.") * 4.6) / 2), 32)
- $g2_Progress1 = GUICtrlCreateProgress(($g2_width / 2) - (($g2_width - 40) / 2), 88, $g2_width - 40, 25)
- $g2_Label2 = GUICtrlCreateLabel("Attente d'informations...", 25, 114, 300, 40)
- GUISetState(@SW_HIDE)
- ;GUI principale
- $F1 = GUICreate("Minecraft.fr", $F1Width, $F1Height, (@DesktopWidth / 2) - ($F1Width / 2), (@DesktopHeight / 2) - ($F1Height / 2), $WS_POPUP)
- $PicFond = GUICtrlCreatePic($df & "fond.jpg", 0, 0, $F1Width, $F1Height)
- GUICtrlSetState($PicFond, $GUI_DISABLE)
- $picClose = PngGuiCreatePic($df & "btnClose.png", $F1Width - 20, $F1Height - $F1Height)
- $btnMc = GUICtrlCreatePic($df & "btnMc.bmp", $F1Width / 1.2841 - 130, ($F1Height / 1.19) - 28, 130, 28)
- If $ping <> 0 Then
- $btnMcFr = GUICtrlCreatePic($df & "btnMcFr.bmp", $F1Width / 1.0362 - 130, ($F1Height / 1.19) - 28, 130, 28)
- Else
- $btnMcFr = ""
- EndIf
- ;$btnOptions = PngGuiCreatePic($df&"btnOptions.bmp", ($F1Width/1.67)-28, ($F1Height/1.19)-28)
- $btnOptions = ""
- $btnSaveState = IniRead($df & "launcher.ini", "GUI", "Save", "off")
- $btnSave = PngGuiCreatePic($df & "save_" & $btnSaveState & ".png", ($F1Width / 1.2195), ($F1Height / 1.6368) - 28)
- GUICtrlSetImage($btnSave, $df & "save_" & $btnSaveState & ".bmp")
- $btnNewsFeed = GUICtrlCreatePic("", 24, 40, 388, 250)
- ;Inputs
- $username = IniRead($df & "launcher.ini", "GUI", "Username", "Nom d'utilisateur")
- If $username = "" Then $username = "Nom d'utilisateur"
- If $btnSaveState = "on" Then
- $password = _StringEncrypt(0, IniRead($df & "launcher.ini", "GUI", "Password", "Password"), "Stallman", 1)
- Else
- $password = "Password"
- EndIf
- If $password = "" Then $password = "Password"
- $inputUsername = GUICtrlCreateInput($username, ($F1Width / 1.7777), $F1Height / 2.658, 200, 30)
- GUICtrlSetTip($inputUsername, "Votre nom de compte")
- $inputPassword = GUICtrlCreateInput($password, ($F1Width / 1.7777), $F1Height / 1.9316, 200, 30, $ES_PASSWORD)
- GUICtrlSetTip($inputPassword, "Le mot de passe de votre compte")
- GUICtrlSetFont($inputUsername, 13, 400, 0, "Minecraft")
- GUICtrlSetFont($inputPassword, 13, 400, 0, "Minecraft")
- $picMove = GUICtrlCreatePic("", 0, 0, $F1Width - 20, 20)
- GUISetState()
- ;Module "Si il n'a pas (le bon?) minecraft_modded.jar, alors le retélécharger depuis Minecraft.fr
- If $ping <> 0 Then
- $modVersion = IniRead($df & "launcher.ini", "GUI", "Version", "")
- $modWeight = IniRead($df & "launcher.ini", "GUI", "Weight", "")
- $modVersion = _StringEncrypt(0, $modVersion, "Stallman")
- If FileExists(@TempDir & "\Launcher_MinecraftFr_version.txt") Then FileDelete(@TempDir & "\Launcher_MinecraftFr_version.txt")
- $ret = _InetgetX($ftp, $justFtpDir & "/version.htm", @TempDir & "\Launcher_MinecraftFr_version.txt")
- ;~ InputBox("", "", FileRead(@TempDir & "\Launcher_MinecraftFr_version.txt"))
- $modGoodVersion = FileReadLine(@TempDir & "\Launcher_MinecraftFr_version.txt", 1)
- FileDelete(@TempDir & "\Launcher_MinecraftFr_version.txt")
- If DirGetSize(@AppDataDir & "\.minecraft\Minecraft.fr") = -1 Then $modVersion = "0.0.0"
- Debug("Version : " & $modVersion & "/" & $modGoodVersion)
- If StringCompare($modGoodVersion, $modVersion) <> 0 Then
- Debug(@CRLF & "Jeu pas à jour. Mise à jour...")
- GUISetState(@SW_SHOW, $F2)
- GUISetState(@SW_HIDE, $F1)
- GUICtrlSetData($g2_Progress1, 25)
- GUICtrlSetData($g2_Label2, "Téléchargement...")
- $hUpdate = InetGet($ftpDir & "/Minecraft.fr.zip", @TempDir & "\.minecraft.zip", 1, 1)
- $updateSize = InetGetSize($ftpDir & "/Minecraft.fr.zip")
- Debug("Téléchargement de la mise à jour de " & $updateSize & " bytes")
- $updateProgress = 0
- While $updateProgress < $updateSize
- $updateProgress = InetGetInfo($hUpdate, 0)
- $updateProgressPercent = (($updateProgress / $updateSize) * 100)
- GUICtrlSetData($g2_Progress1, 25 + $updateProgressPercent / 2) ;la partie download ne couvre que 50% de la progressbar (de 25 a 75%)
- GUICtrlSetData($g2_Label2, "Téléchargement... [" & Int($updateProgressPercent) & "%]")
- Sleep(30)
- WEnd
- GUICtrlSetData($g2_Label2, "Extraction...")
- GUICtrlSetData($g2_Progress1, 75)
- _7ZIPExtractEx(0, @TempDir & "\.minecraft.zip", @AppDataDir & "\.minecraft", 1)
- GUICtrlSetData($g2_Label2, "Nettoyage...")
- GUICtrlSetData($g2_Progress1, 100)
- FileDelete(@TempDir & "\.minecraft.zip")
- GUICtrlSetData($g2_Label2, "Terminé !")
- GUISetState(@SW_HIDE, $F2)
- GUISetState(@SW_SHOW, $F1)
- IniWrite($df & "launcher.ini", "GUI", "Version", _StringEncrypt(1, $modGoodVersion, "Stallman"))
- Debug("Fait !" & @CRLF)
- EndIf
- EndIf
- ;NewsFeed
- $hNews = InetGet($ftpDir & "/NewsFeed.php", "NewsFeed.txt", 1, 1)
- $newsSize = InetGetSize($ftpDir & "/NewsFeed.php")
- AdlibRegister("UpdateNewsFeed", 100)
- Debug("Téléchargement des news lancé.")
- If @ScriptName <> "Src.au3" Then
- If @ScriptName <> "Src.exe" Then
- InetGet($ftpDir & "/log.php?action=join", @TempDir & "\todel.dat", 1)
- FileDelete(@TempDir & "\todel.dat")
- OnAutoItExitRegister("Cleanup")
- $exitcode = False
- EndIf
- EndIf
- $btnMcState = False
- $btnMcFrState = False
- While 1
- $mousepos = MouseGetPos()
- $F1pos = WinGetPos("Minecraft.fr")
- $F1pos[0] = $mousepos[0] - $F1pos[0]
- $F1pos[1] = $mousepos[1] - $F1pos[1]
- ;Gestion des collisions avec les bouton
- If SquareCol($F1pos[0], $F1pos[1], $F1Width / 1.0362 - 130, ($F1Height / 1.19) - 28, 130, 28) = 1 Then ;Est dedans
- If $btnMcFrState = False Then ;Vient d'arriver
- GUICtrlSetImage($btnMcFr, $df & "btnMcFr_on.bmp")
- $btnMcFrState = True
- EndIf
- Else ;Est dehors
- If $btnMcFrState = True Then ;Vient de sortir
- GUICtrlSetImage($btnMcFr, $df & "btnMcFr.bmp")
- $btnMcFrState = False
- EndIf
- EndIf
- If SquareCol($F1pos[0], $F1pos[1], $F1Width / 1.2841 - 130, ($F1Height / 1.19) - 28, 130, 28) = 1 Then ;Est dedans
- If $btnMcState = False Then ;vient d'arriver
- GUICtrlSetImage($btnMc, $df & "btnMc_on.bmp")
- $btnMcState = True
- EndIf
- Else ;Est dehors
- If $btnMcState = True Then ;vient de sortir
- GUICtrlSetImage($btnMc, $df & "btnMc.bmp")
- $btnMcState = False
- EndIf
- EndIf
- ;banalités gui
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $picMove
- While _IsPressed(1)
- $mousepos = MouseGetPos()
- WinMove("Minecraft.fr", "", $mousepos[0] - $F1pos[0], $mousepos[1] - $F1pos[1])
- WEnd
- Case $GUI_EVENT_CLOSE
- Cleanup()
- Case $picClose
- Cleanup()
- Case $btnOptions
- GUICtrlSetImage($btnOptions, $df & "btnOptions_on.bmp")
- Sleep(10)
- GUICtrlSetImage($btnOptions, $df & "btnOptions.bmp")
- Case $btnSave
- If $btnSaveState = "on" Then
- GUICtrlSetImage($btnSave, $df & "save_off.bmp")
- $btnSaveState = "off"
- IniWrite($df & "launcher.ini", "GUI", "Save", "off")
- Else
- GUICtrlSetImage($btnSave, $df & "save_on.bmp")
- $btnSaveState = "on"
- IniWrite($df & "launcher.ini", "GUI", "Save", "on")
- EndIf
- Case $btnMcFr
- GUICtrlSetImage($btnMcFr, $df & "btnMcFr_on.bmp")
- If $btnSaveState = "on" Then
- IniWrite($df & "launcher.ini", "GUI", "Password", _StringEncrypt(1, GUICtrlRead($inputPassword), "Stallman", 1))
- IniWrite($df & "launcher.ini", "GUI", "Username", GUICtrlRead($inputUsername))
- EndIf
- NormalToModded()
- LaunchMinecraft(" minecraft.mtxserv.fr")
- GUICtrlSetImage($btnMcFr, $df & "btnMcFr.bmp")
- Case $btnMc
- GUICtrlSetImage($btnMc, $df & "btnMc_on.bmp")
- If $btnSaveState = "on" Then
- IniWrite($df & "launcher.ini", "GUI", "Password", _StringEncrypt(1, $password, "Stallman", 1))
- IniWrite($df & "launcher.ini", "GUI", "Username", $username)
- EndIf
- ModdedToNormal()
- LaunchMinecraft()
- GUICtrlSetImage($btnMc, $df & "btnMc.bmp")
- Case $btnNewsFeed
- ShellExecute("http://serveurmcfr.mtxserv.fr")
- EndSwitch
- WEnd
- Func Cleanup()
- If $exitcode = False Then
- InetGet("http://ds43.site90.net/log.php?action=quit", @TempDir & "\todel.dat", 1)
- FileDelete(@TempDir & "\todel.dat")
- EndIf
- IniWrite($df & "launcher.ini", "GUI", "Save", $btnSaveState)
- _GDIPlus_Shutdown()
- Exit
- EndFunc ;==>Cleanup
- Func PngGuiCreatePic($src, $x, $y, $w = -1, $h = -1, $alt = "")
- Local $gdi_state = $ghGDIPDll
- If $ghGDIPDll = 0 Then _GDIPlus_Startup()
- $hImage2 = _GDIPlus_ImageLoadFromFile($src)
- If $w <> -1 Or $h <> -1 Then
- $ImageHeight = $h ; ###
- $ImageWidth = $w ; ###
- $hBitmap = _WinAPI_CreateBitmap($ImageWidth, $ImageHeight, 1, 32)
- $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
- $hgraphic = _GDIPlus_ImageGetGraphicsContext($hImage1)
- _GDIPlus_GraphicsDrawImageRect($hgraphic, $hImage2, 0, 0, $ImageWidth, $ImageHeight)
- $hBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage1)
- _WinAPI_DeleteObject($hBitmap)
- _GDIPlus_ImageDispose($hImage1)
- _GDIPlus_GraphicsDispose($hgraphic)
- Else
- $ImageHeight = _GDIPlus_ImageGetHeight($hImage2) ; ###
- $ImageWidth = _GDIPlus_ImageGetWidth($hImage2) ; ###
- Local $hBitmap, $hBitmap2
- $hBitmap = _GDIPlus_BitmapCreateFromFile($src)
- $hBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
- _GDIPlus_BitmapDispose($hBitmap)
- EndIf
- $pic = GUICtrlCreatePic("", $x, $y, $ImageWidth, $ImageHeight)
- If $alt <> "" Then GUICtrlSetTip($pic, $alt)
- GUICtrlSendMsg($pic, 0x0172, 0, $hBitmap2)
- If $gdi_state = 0 Then _GDIPlus_Shutdown()
- Return $pic
- EndFunc ;==>PngGuiCreatePic
- Func LaunchMinecraft($server = "")
- If Not FileExists(@AppDataDir & "\.minecraft\Minecraft.exe") Then
- Debug("Minecraft.exe introuvable dans le dossier .minecraft. Téléchargement.")
- InetGet($ftpDir & "/Minecraft.exe", @AppDataDir & "\.minecraft\Minecraft.exe", 1)
- ElseIf FileGetSize(@AppDataDir & "\.minecraft\Minecraft.exe") <> 270142 Then
- Debug("Minecraft.exe trouvé dans le dossier .minecraft mais il n'a pas la bonne taille. Téléchargement.")
- FileDelete(@AppDataDir & "\.minecraft\Minecraft.exe")
- InetGet($ftpDir & "/Minecraft.exe", @AppDataDir & "\.minecraft\Minecraft.exe", 1)
- EndIf
- If $ping = 0 Then
- ShellExecute(@AppDataDir & "\.minecraft\Minecraft.exe", $username & " " & $password)
- Exit
- EndIf
- $username = GUICtrlRead($inputUsername)
- $password = GUICtrlRead($inputPassword)
- ShellExecute(@AppDataDir & "\.minecraft\Minecraft.exe", $username & " " & $password & $server)
- $temp = 0
- While $temp = 0
- $temp = WinSetState("Minecraft Launcher", "", @SW_HIDE)
- WEnd
- $existed = 0
- $dif = 0
- While 1
- If $existed > 0 And Not WinExists("Minecraft Launcher") Then
- Debug("Minecraft launcher a disparu !")
- Sleep(1000)
- WinSetState("Minecraft", "", @SW_SHOW)
- Run($checkerdir)
- Exit
- ElseIf WinExists("Minecraft Launcher") And $existed = 0 Then
- Debug("Minecraft launcher trouvé")
- $existed = TimerInit()
- ElseIf $dif > 5000.0 Then
- Debug("Minecraft launcher met trop longtemps à disparaitre !")
- ProcessClose(WinGetProcess("Minecraft Launcher"))
- MsgBox(16, "Erreur", "Impossible de se connecter à Minecraft.net. Mauvais nom de compte ou mot de passe ?")
- ExitLoop
- EndIf
- If $existed <> 0 Then
- $dif = TimerDiff($existed)
- EndIf
- Sleep(500)
- WEnd
- EndFunc ;==>LaunchMinecraft
- Func NormalToModded()
- $jartype = RegRead($registry, "IsNormalJar")
- If $jartype = "" Then Return -1
- $jartype = Dec($jartype)
- If $jartype = 1 Then
- FileMove($minecraftdir & "\bin\minecraft.jar", $minecraftdir & "\Minecraft.fr\minecraft_original.jar")
- FileMove($minecraftdir & "\Minecraft.fr\minecraft_modded.jar", $minecraftdir & "\bin\minecraft.jar")
- RegWrite($registry, "IsNormalJar", "REG_DWORD", Hex(0))
- Return 1
- Else
- Return 0
- EndIf
- EndFunc ;==>NormalToModded
- Func ModdedToNormal()
- $jartype = RegRead($registry, "IsNormalJar")
- If $jartype = "" Then Return -1
- $jartype = Dec($jartype)
- If $jartype = 0 Then
- FileMove($minecraftdir & "\bin\minecraft.jar", $minecraftdir & "\Minecraft.fr\minecraft_modded.jar")
- FileMove($minecraftdir & "\Minecraft.fr\minecraft_original.jar", $minecraftdir & "\bin\minecraft.jar")
- RegWrite($registry, "IsNormalJar", "REG_DWORD", Hex(1))
- Return 1
- Else
- Return 0
- EndIf
- EndFunc ;==>ModdedToNormal
- Func UpdateNewsFeed()
- If $ping = 0 Then
- Debug("Utilisateur non connecté à internet, pas de news.")
- AdlibUnRegister("UpdateNewsFeed")
- Return 0
- EndIf
- Debug("Etat du téléchargement : " & InetGetInfo($hNews, 0) & "/" & $newsSize & " bytes")
- If InetGetInfo($hNews, 2) = True Then
- Debug("Mise en place des news dans l'encadré")
- $sString = FileRead("NewsFeed.txt")
- $sString = StringSplit($sString, "||", 1)
- FileDelete("NewsFeed.txt")
- If UBound($sString) < 4 Then
- Debug("Le serveur de news n'a pas su offrir le contenu de l'encadré gauche")
- Local $sString[4]
- $sString[1] = "Erreur"
- $sString[2] = "News introuvables"
- $sString[3] = "Nous sommes désolés, mais nous n'avons pu trouver de news à afficher sur le serveur. Erreur 404."
- AdlibUnRegister("UpdateNewsFeed")
- EndIf
- _GDIPlus_Startup()
- $hNews = _GDIPlus_GraphicsCreateFromHWND($F1)
- $hBrush = _GDIPlus_BrushCreateSolid(0x99FFFFFF)
- $hFormat = _GDIPlus_StringFormatCreate(0x4000)
- If $policesOk Then
- $hFamily = _GDIPlus_FontFamilyCreate("Berlin Sans FB")
- Debug("Police Berlin Sans FB utilisée.")
- Else
- $hFamily = _GDIPlus_FontFamilyCreate("Arial")
- Debug("Police Arial utilisée.")
- EndIf
- If $hFamily = 0 Then Debug("Erreur de police")
- $hFontContenu = _GDIPlus_FontCreate($hFamily, 10, 0)
- $hFontTitre = _GDIPlus_FontCreate($hFamily, 15, 0)
- $hFontAnnonce = _GDIPlus_FontCreate($hFamily, 20, 0)
- $tNewsAnnonce = _GDIPlus_RectFCreate(31, 46, 388, 250)
- $tNewsTitre = _GDIPlus_RectFCreate(31, 75, 388, 250)
- $tNewsContenu = _GDIPlus_RectFCreate(44, 100, 388, 250)
- If $hBrush And $hFormat And $hFamily And $hFontAnnonce And $hFontContenu And $hFontTitre Then
- Debug("Contenu des news écrit")
- Else
- Debug("Impossible d'écrire le contenu des news. Erreur.")
- EndIf
- _GDIPlus_GraphicsDrawStringEx($hNews, $sString[1], $hFontAnnonce, $tNewsAnnonce, $hFormat, $hBrush)
- _GDIPlus_GraphicsDrawStringEx($hNews, $sString[2], $hFontTitre, $tNewsTitre, $hFormat, $hBrush)
- _GDIPlus_GraphicsDrawStringEx($hNews, $sString[3], $hFontContenu, $tNewsContenu, $hFormat, $hBrush)
- AdlibUnRegister("UpdateNewsFeed")
- Debug("Fin.")
- Return 1
- ElseIf InetGetInfo($hNews, 4) <> 0 Then
- MsgBox(16, "Erreur", "Le serveur de news répond bien mais ne délivre que des erreurs." & @CRLF & @CRLF & $ftpDir & "/version.htm")
- AdlibUnRegister("UpdateNewsFeed")
- Return 0
- EndIf
- EndFunc ;==>UpdateNewsFeed
- Func SquareCol($x, $y, $left, $top, $width, $height)
- If $x >= $left And $x <= $left + $width Then ;Dedans horizontalement
- If $y >= $top And $y <= $top + $height Then ; Dedans verticalement
- Return 1
- EndIf
- EndIf
- Return 0
- EndFunc ;==>SquareCol
- Func Debug($text)
- GUICtrlSetData($DebugCons, $text & @CRLF, 1)
- _Console($text)
- EndFunc ;==>Debug
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement