Code : Tout sélectionner
#include <GUIConstants.au3>
#include <File.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 389, 660, 190, 126)
$e = GUICtrlCreateEdit("", 5, 6, 369, 577)
$Button1 = GUICtrlCreateButton("enregistrer", 8, 592, 369, 33)
GUICtrlSetFont(-1, 22, 800, 0, "Arial Black")
$input = GUICtrlCreateInput("", 8, 632, 369, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$ex = ''
$title = ''
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_enregistre()
EndSwitch
WEnd
Func _enregistre()
$ex = GUICtrlRead($e)
$title = GUICtrlRead($input)
If $ex <> '' Then
If $title <> '' Then
$file = @MyDocumentsDir & "/" & $title & ".au3"
_FileCreate($file)
FileWrite($file, $ex)
Else
msgbox(0, "", "erreur")
EndIf
Else
msgbox(0, "", "erreur")
EndIf
EndFunc