Je vais vous présenter un de mes (2) programmes finis, FramaCopy. Petite capture : (en bas)
Qu'est que c'est ?
FramaCopy un un logiciel destiné à copier facilement des FramaKeys personnalisées, pour vos amis, famille, collègues, etc.
Les FramaKeys copiées contiendront exactement les mêmes programmes et données que la clé originale.
Comment ça marche ?
FramaCopy récupère les infos entrées dans la GUI, les insère dans un fichier batch et vous demande de l'enregistrer. Une fois cela fait, vous n'avez plus qu'à lancer le batch et ... attendre.
Et maintenant, le script :
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
Opt("GUIOnEventMode", 1)
#Region ### GUI Begin ### Début GUI
$FramaCopy = GUICreate("FramaCopy", 700, 393, 250, 178)
GUISetOnEvent($GUI_EVENT_CLOSE, "FCClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "FCMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "FCMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "FCRestore")
;==========Menu==========
;Global $MenuFile = GUICtrlCreateMenu("&Fichier")
;GUICtrlSetOnEvent($MenuFile, "")
;Global $MenuFileOpen = GUICtrlCreateMenuItem("Ouvrir", $MenuItem3)
;GUICtrlSetOnEvent($MenuFileOpen, "Open")
;Global $MenuFileSave = GUICtrlCreateMenuItem("Enregistrer", $MenuItem3)
;GUICtrlSetOnEvent($MenuFileSave, "Save")
;Global $MenuFileQuit = GUICtrlCreateMenuItem("Quitter", $MenuItem3)
;GUICtrlSetOnEvent($MenuFileQuit, "FCClose")
;Global $MenuSetup = GUICtrlCreateMenu("&Options")
;GUICtrlSetOnEvent($MenuSetup, "")
;Global $MenuSetupSite1 = GUICtrlCreateMenuItem("Site du FramaCopy", $MenuItem1)
;GUICtrlSetOnEvent($MenuSetupSite1, "Site1")
;Global $MenuSetupSite2 = GUICtrlCreateMenuItem("Framakey.org", $MenuItem1)
;GUICtrlSetOnEvent($MenuSetupSite2, "Site2")
;Global $MenuSetupAbout = GUICtrlCreateMenuItem("A propos", $MenuItem1)
;GUICtrlSetOnEvent($MenuSetupAbout, "About")
;==========Logo==========
GUICtrlCreatePic(@ScriptDir&"\Framacopy.bmp", 8, 8, 233, 232, BitOR($GUI_SS_DEFAULT_PIC,$WS_CLIPSIBLINGS))
GUICtrlSetOnEvent(-1, "Site2")
GUICtrlCreateGroup("Clés cibles", 256, 80, 353, 273)
;==========Labels Cibles==========
GUICtrlCreateLabel("Clé 1", 264, 104, 28, 17, 0)
GUICtrlCreateLabel("Clé 2", 440, 103, 28, 17, 0)
GUICtrlCreateLabel("Clé 3", 264, 128, 28, 17, 0)
GUICtrlCreateLabel("Clé 4", 440, 128, 28, 17, 0)
GUICtrlCreateLabel("Clé 7", 264, 176, 28, 17, 0)
GUICtrlCreateLabel("Clé 5", 264, 152, 28, 17, 0)
GUICtrlCreateLabel("Clé 6", 440, 152, 28, 17, 0)
GUICtrlCreateLabel("Clé 8", 440, 176, 28, 17, 0)
GUICtrlCreateLabel("Clé 9", 264, 200, 28, 17, 0)
GUICtrlCreateLabel("Clé 10", 440, 200, 34, 17, 0)
GUICtrlCreateLabel("Clé 11", 264, 224, 34, 17, 0)
GUICtrlCreateLabel("Clé 12", 440, 224, 34, 17, 0)
GUICtrlCreateLabel("Clé 13", 264, 248, 34, 17, 0)
GUICtrlCreateLabel("Clé 14", 440, 248, 34, 17, 0)
GUICtrlCreateLabel("Clé 15", 264, 272, 34, 17, 0)
GUICtrlCreateLabel("Clé 16", 440, 272, 34, 17, 0)
GUICtrlCreateLabel("Clé 17", 264, 296, 34, 17, 0)
GUICtrlCreateLabel("Clé 18", 440, 296, 34, 17, 0)
GUICtrlCreateLabel("Clé 19", 264, 320, 34, 17, 0)
GUICtrlCreateLabel("Clé 20", 440, 320, 34, 17, 0)
;==========Inputs Cibles==========
$K1 = GUICtrlCreateInput("", 304, 104, 121, 21)
$K2 = GUICtrlCreateInput("", 480, 104, 121, 21)
$K3 = GUICtrlCreateInput("", 304, 128, 121, 21)
$K4 = GUICtrlCreateInput("", 480, 128, 121, 21)
$K5 = GUICtrlCreateInput("", 304, 152, 121, 21)
$K6 = GUICtrlCreateInput("", 480, 152, 121, 21)
$K7 = GUICtrlCreateInput("", 304, 176, 121, 21)
$K8 = GUICtrlCreateInput("", 480, 176, 121, 21)
$K9 = GUICtrlCreateInput("", 304, 200, 121, 21)
$K10 = GUICtrlCreateInput("", 480, 200, 121, 21)
$K11 = GUICtrlCreateInput("", 304, 224, 121, 21)
$K12 = GUICtrlCreateInput("", 480, 224, 121, 21)
$K13 = GUICtrlCreateInput("", 304, 248, 121, 21)
$K14 = GUICtrlCreateInput("", 480, 248, 121, 21)
$K15 = GUICtrlCreateInput("", 304, 272, 121, 21)
$K16 = GUICtrlCreateInput("", 480, 272, 121, 21)
$K17 = GUICtrlCreateInput("", 304, 296, 121, 21)
$K18 = GUICtrlCreateInput("", 480, 296, 121, 21)
$K19 = GUICtrlCreateInput("", 304, 320, 121, 21)
$K20 = GUICtrlCreateInput("", 480, 320, 121, 21)
;==========Groupe Source==========
GUICtrlCreateGroup("Source", 256, 0, 353, 81)
Global $SourceKey = GUICtrlCreateInput("Clé/Dossier Source", 264, 24, 337, 21, $GUI_SS_DEFAULT_INPUT)
Global $FramaName = GUICtrlCreateInput("Nom des clés", 264, 48, 337, 21)
Global $OK = GUICtrlCreateButton("Enregistrer !", 8, 256, 235, 84, 0)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
GUICtrlSetBkColor(-1, 0x00FF00)
GUICtrlSetOnEvent(-1, "OKClick")
Global $Status = _GUICtrlStatusBar_Create($FramaCopy)
_GUICtrlStatusBar_SetSimple($Status)
_GUICtrlStatusBar_SetText($Status, "Remplissez les champs. Vous devez remplir au moins 1 champ de clé, sans les 2 points(:) et sans le slash.")
GUISetState(@SW_SHOW)
#EndRegion ### GUI End ### Fin GUI
Func OKClick()
$content = ""
Global $BatLoc = FileSaveDialog("Enregistrer sous", @ScriptDir, "Batch File (*.bat)", 16, "FKCopy.bat")
$content &="@echo off" & @CRLF
$content &="title FramaKey Duplication System - FKCopy" & @CRLF
$content &="color 0a" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo G‚n‚ration du batch..." & @CRLF
$content &="echo Batch g‚n‚r‚" & @CRLF
$content &="echo Appuyez sur Entr‚e pour formater les cl‚s" & @CRLF
$content &="pause" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="format "& GUICtrlRead ($K1)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K2)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K3)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K4)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K5)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K6)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K7)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K8)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K9)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K10)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K11)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K12)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K13)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K14)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K15)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K16)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K17)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K18)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K19)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K20)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Appuyez sur Entr‚e pour copier les fichiers Framakey" & @CRLF
$content &="pause" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Copie des fichiers" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K1)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K2)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K3)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K4)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K5)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K6)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K7)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K8)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K9)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K10)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K11)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K12)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K13)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K14)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K15)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K16)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K17)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K18)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K19)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&":"& GUICtrlRead ($K20)&": /MIR" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Copie termin‚e" & @CRLF
$content &="echo Cl,(s) pr^tes !" & @CRLF
$content &="echo Appuyez sur une touche pour fermer..." & @CRLF
$content &="pause" & @CRLF
$batch_file = FileOpen($BatLoc, 2)
FileWrite($batch_file, $content)
FileClose($batch_file)
Sleep (100)
EndFunc
Func Site2()
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe http://www.framakey.org/")
EndFunc
Func FCClose()
Exit
EndFunc ;==>FCClose
Func FCMaximize()
EndFunc ;==>FCMaximize
Func FCMinimize()
$FramaCopyIsOpen = False
EndFunc ;==>FCMinimize
Func FCRestore()
$FramaCopyIsOpen = True
EndFunc ;==FCRestore
While 1
Sleep(100)
WEnd
Des avis, des suggestions, c'est ici !