Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $pass="Les",$mdp="",$cptMdp=0,$Form1,$Group1,$Checkbox1,$Checkbox2,$Checkbox3, _
$Checkbox4,$Checkbox5,$Checkbox6,$Label1,$Button1,$Button2,$Button3
_DemandeMdp() ; on demande le mot de passe, possibilite de 3 essai
_GuiMain() ; on affiche la GUI principale si Mdp est bon
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
Select
Case isChecked($Checkbox1)
_runFacebook()
Case isChecked($Checkbox2)
; a completer
Case isChecked($Checkbox3)
; a completer
Case isChecked($Checkbox4)
; a completer
Case isChecked($Checkbox5)
_runGoogle()
Case isChecked($Checkbox6)
; a completer
EndSelect
EndSwitch
WEnd
Func _DemandeMdp()
$mdp = InputBox("Utilisateurs", "Entrez le mot de passe :"&@CRLF&"Test restant "&3-$cptMdp&"/3","","*")
If $pass <> $mdp Then
$cptMdp=$cptMdp+1
If $cptMdp = 3 Then Exit
_DemandeMdp()
Else
MsgBox(0,"Utilisateurs", "Le mot de passe est correct !")
EndIf
EndFunc
Func _runGoogle()
ShellExecute("http://google.be")
EndFunc
Func _runFacebook()
ShellExecute("http://google.be")
EndFunc
Func _GuiMain()
$Form1 = GUICreate("Utilisateurs Windows", 249, 218, 192, 114)
$Group1 = GUICtrlCreateGroup("Page à ouvrir :", 16, 32, 137, 177)
$Checkbox1 = GUICtrlCreateCheckbox("Facebook", 32, 80, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Hotmail", 32, 104, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Funradio", 32, 128, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Blog Espagnol", 32, 152, 97, 17)
$Checkbox5 = GUICtrlCreateCheckbox("Google", 32, 56, 97, 17)
$Checkbox6 = GUICtrlCreateCheckbox("AutoIt Forum", 32, 176, 97, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("Choissisez les pages que vous souhaitez ouvrir.", 16, 8, 228, 17)
$Button1 = GUICtrlCreateButton("Quitter", 176, 152, 57, 49, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Lancer", 176, 48, 57, 49, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Nettoyer", 176, 112, 57, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
EndFunc
Func isChecked($checkbox)
Return BitAND(GUICtrlRead($checkbox),$GUI_CHECKED) = $GUI_CHECKED
EndFunc