Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#NoTrayIcon
Trombi()
Func Trombi()
$Trombi = GUICreate("Trombinoscope", 514, 480, 355, 256)
$Groupe_photo = GUICtrlCreateGroup(" Photo ", 8, 32, 161, 201)
$Photo = GUICtrlCreatePic("C:\Documents and Settings\*****\Bureau\identite.jpg", 16, 48, 145, 178)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Groupe_information = GUICtrlCreateGroup(" Information ", 176, 32, 329, 201)
$Nom = GUICtrlCreateLabel("Nom :", 192, 56, 32, 17)
$Prenom = GUICtrlCreateLabel("Prénom :", 192, 80, 46, 17)
$Service = GUICtrlCreateLabel("Service :", 192, 104, 46, 17)
$Fonction = GUICtrlCreateLabel("Fonction :", 192, 128, 51, 17)
$Num_externe = GUICtrlCreateLabel("Num de tel externe :", 192, 152, 99, 17)
$Num_interne = GUICtrlCreateLabel("Num de tel interne :", 192, 176, 96, 17)
$Mail = GUICtrlCreateLabel("Adresse @mail :", 192, 200, 80, 17)
$Nom_label_info = GUICtrlCreateLabel("", 304, 56, 196, 17)
$Prenom_label_info = GUICtrlCreateLabel("", 304, 80, 196, 17)
$Service_label_info = GUICtrlCreateLabel("", 304, 104, 196, 17)
$Fonction_label_info = GUICtrlCreateLabel("", 304, 128, 196, 17)
$Num_tel_ext_label_info = GUICtrlCreateLabel("", 304, 152, 196, 17)
$Num_tel_int_label_info = GUICtrlCreateLabel("", 304, 176, 196, 17)
$Mail_label_info = GUICtrlCreateLabel("", 304, 200, 196, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Groupe_recherche = GUICtrlCreateGroup(" Recherche ", 8, 240, 497, 201)
$Categorie = GUICtrlCreateList("", 16, 256, 153, 175)
GUICtrlSetData(-1, "A. Nom|B. Prénom|C. Service|D. Fonction|E. Num de tel interne|F. Num de tel externe|G. Adresse @mail")
$Recherche = GUICtrlCreateInput("Recherche", 176, 256, 209, 21)
$Groupe_resultat = GUICtrlCreateGroup(" Resultat ", 176, 280, 321, 153)
$Resultat = GUICtrlCreateList("", 184, 296, 305, 123)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Rechercher = GUICtrlCreateButton("Rechercher", 392, 254, 105, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Ajouter = GUICtrlCreateButton("Ajouter", 8, 448, 171, 25, 0)
$Quitter = GUICtrlCreateButton("Quitter", 336, 448, 171, 25, 0)
$Barre_de_progression = GUICtrlCreateProgress(184, 450, 148, 21)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Rechercher
$filee = "_" & GuictrlRead($Recherche) & ".ini"
If FileExists($filee) Then
GUICtrlSetData($Nom_label_info, IniRead ( $filee, "Nom", "key", ""))
GUICtrlSetData($Prenom_label_info, IniRead ( $filee, "Prenom", "key", ""))
GUICtrlSetData($Service_label_info, IniRead ( $filee, "Service", "key", ""))
GUICtrlSetData($Fonction_label_info, IniRead ( $filee, "Fonction", "key", ""))
GUICtrlSetData($Num_tel_ext_label_info, IniRead ( $filee, "Numero de telephone externe", "key", ""))
GUICtrlSetData($Num_tel_int_label_info, IniRead ( $filee, "Numero de telephone interne", "key", ""))
GUICtrlSetData($Mail_label_info, IniRead ( $filee, "Mail", "key", ""))
Else
Exit
EndIf
Case $Ajouter
GUISetState(@SW_hide)
Ajout_fiche_perso()
Case $Quitter
Exit
EndSwitch
WEnd
EndFunc
Func Rechercher()
EndFunc
Func Ajout_fiche_perso()
$Trombi_ajout = GUICreate("Trombinoscope - Ajout d'un profil", 514, 271, 343, 326)
$Group_photo_ajout = GUICtrlCreateGroup(" Photo ", 8, 32, 161, 201)
$Photo_ = GUICtrlCreatePic("C:\Documents and Settings\******\Bureau\identite.jpg", 16, 48, 145, 178)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Ajout_photo = GUICtrlCreateButton("Ajouter une photo", 8, 240, 161, 25, 0)
$Group_info_ajout = GUICtrlCreateGroup(" Information ", 176, 33, 329, 201)
$Nom_label = GUICtrlCreateLabel("Nom :", 184, 57, 32, 17)
$Prenom_label = GUICtrlCreateLabel("Prénom :", 184, 81, 46, 17)
$Service_label = GUICtrlCreateLabel("Service :", 184, 105, 46, 17)
$Fonction_label = GUICtrlCreateLabel("Fonction :", 184, 129, 51, 17)
$Num_tel_externe_label = GUICtrlCreateLabel("Num de tel externe :", 184, 153, 99, 17)
$Num_tel_interne_label = GUICtrlCreateLabel("Num de tel interne :", 184, 177, 96, 17)
$Mail_label = GUICtrlCreateLabel("Adresse @mail :", 184, 201, 80, 17)
$Nom_ajout = GUICtrlCreateInput("", 296, 53, 201, 21)
$Prenom_ajout = GUICtrlCreateInput("", 296, 77, 201, 21)
$Service_ajout = GUICtrlCreateInput("", 296, 101, 201, 21)
$Fonction_ajout = GUICtrlCreateInput("", 296, 125, 201, 21)
$Num_tel_externe_ajout = GUICtrlCreateInput("", 296, 149, 201, 21)
$Num_tel_interne_ajout = GUICtrlCreateInput("", 296, 173, 201, 21)
$Mail_ajout = GUICtrlCreateInput("", 296, 197, 201, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Annuler = GUICtrlCreateButton("Annuler", 344, 240, 161, 25, 0)
$Valider = GUICtrlCreateButton("Valider", 176, 240, 161, 25, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete()
Return
Case $Annuler
GUISetState(@SW_hide)
Trombi()
Case $Ajout_photo
Ajout_photo() ; a faire =============================================================================================
case $Valider
If FileExists ("_" & GuictrlRead($Nom_ajout) & ".ini") Then
MsgBox(0, "Erreur", "La fiche existe déjà")
GUISetState(@SW_hide)
Ajout_fiche_perso()
ElseIf Not FileExists ("_" & GuictrlRead($Nom_ajout) & ".ini") Then
$recencement = FileOpen("recencement.txt", 1)
$file = FileOpen("_" & GuictrlRead($Nom_ajout) & ".ini",9)
If $file = -1 Then
MsgBox(0, "Erreur", "Impossible de créer la fiche.")
GUISetState(@SW_hide)
Ajout_fiche_perso()
EndIf
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Nom" , "key", "" & GuictrlRead($Nom_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Prenom" , "key", "" & GuictrlRead($Prenom_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Service" , "key", "" & GuictrlRead($Service_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Fonction" , "key", "" & GuictrlRead($Fonction_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Numero de telephone externe" , "key", "" & GuictrlRead($Num_tel_externe_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Numero de telephone interne" , "key", "" & GuictrlRead($Num_tel_interne_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Mail" , "key", "" & GuictrlRead($Mail_ajout))
GUIDelete()
Return
EndIf
EndSwitch
WEnd
EndFunc
Func Ajout_photo()
; a faire ========================================================================