oui je l'avais pas sous la main et je me dis qu'il doit y avoir un truc bidon pour que ca ne marche pas les trois fois je l'utilise
donc en gros çà donne ça (j'ai viré ce qui étais inutile)
Code : Tout sélectionner
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=qstv.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=version 1.0.0.0
#AutoIt3Wrapper_Res_Fileversion=1.0.0.11
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=version 1.0.0.0
#AutoIt3Wrapper_Res_Language=1036
#AutoIt3Wrapper_Run_Obfuscator=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Array.au3>
#include <Constants.au3>
#include <WinNet.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Lauch", 622, 210, 192, 124)
$Input1 = GUICtrlCreateInput("", 32, 29, 249, 21)
$Input3 = GUICtrlCreateInput("Administrateur", 32, 75, 249, 21)
$Input2 = GUICtrlCreateInput("", 32, 125, 249, 21, $ES_PASSWORD)
$Label1 = GUICtrlCreateLabel("Taper le mot de passe administrateur", 32, 105, 249, 17)
$Label2 = GUICtrlCreateLabel("Nom du serveur ou pc à débloquer", 32, 10, 177, 17)
$Label3 = GUICtrlCreateLabel("Nom d'utilisateur", 32, 55, 249, 21)
$Button1 = GUICtrlCreateButton("Lancer tv", 32, 160, 100, 41)
$Button2 = GUICtrlCreateButton("refresh ID", 180, 160, 100, 41)
$myedit = GUICtrlCreateEdit("ID poste distant" & @CRLF, 296, 10, 315, 185, $ES_AUTOVSCROLL + $WS_VSCROLL)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Call ("debut")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(4096, "test", "test")
EndSwitch
WEnd
Func debut()
Global $pathgu = "c:\param.txt"
GlobaL $file = FileOpen($pathgu, 0)
Global $line = FileRead($file)
Global $paramgu = StringRegExp($line, "Numero=[1-9]\d{1,7}\b", 3)
Global $sString = StringTrimLeft($paramgu[0], 7)
If IsArray($paramgu[0]) Then
GUICtrlSetData($Input1, '$' & $sString & '$', 1)
Else
;~ MsgBox(4096, "ok:", "continue")
EndIf
EndFunc
donc si le fichier param.txt n'est pas présent ou si ce qu'il y a après "Numero= " n'est pas ce que je recherche la gui se ferme