Code : Tout sélectionner
#RequireAdmin
#NoTrayIcon
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $Titre, $Input, $Btn_1, $Btn_2, $Btn_3
Global $Nom_De_La_Fenetre_1 = "Press"
Global $PassWord_1 = "Autoit"
Global $Indice_1 = "C'est un script en ..."
_close()
Func _close()
If WinExists($Nom_De_La_Fenetre_1) Then
Opt("WinTitleMatchMode", 2)
WinActivate($Nom_De_La_Fenetre_1)
WinSetTrans($Nom_De_La_Fenetre_1, "", 0)
_password()
EndIf
EndFunc
Func _open()
If WinExists($Nom_De_La_Fenetre_1) Then
Opt("WinTitleMatchMode", 2)
WinActivate($Nom_De_La_Fenetre_1)
WinSetTrans($Nom_De_La_Fenetre_1, "", 250)
EndIf
EndFunc
Func _mauvais_password()
ToolTip("C'est un mauvais password", 0, 0, "PassWord", 1, 0)
Sleep(1000*2)
ToolTip("")
EndFunc
Func _bon_password()
ToolTip("C'est le bon password", 0, 0, "PassWord", 1, 0)
Sleep(1000*2)
ToolTip("")
EndFunc
Func _password()
$Titre = GUICreate("PassWord", 283, 75, 100, 100)
$Input = GUICtrlCreateInput("Entrez le password", 8, 8, 265, 21)
$Btn_1 = GUICtrlCreateButton("Quitter", 8, 40, 75, 25, $WS_GROUP)
$Btn_2 = GUICtrlCreateButton("Indice", 104, 40, 75, 25, $WS_GROUP)
$Btn_3 = GUICtrlCreateButton("Valider", 200, 40, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
WinClose($Nom_De_La_Fenetre_1)
Exit 0
Case $Btn_1
WinClose($Nom_De_La_Fenetre_1)
Exit 0
Case $Btn_2
ToolTip($Indice_1, 0, 0, "Indice", 1, 0)
Sleep(1000*2)
ToolTip("")
Case $Btn_3
$Check_Le_Pass_1 = GUICtrlRead($Input)
If $Check_Le_Pass_1 = $PassWord_1 Then
_open()
_bon_password()
Exit 0
Else
_mauvais_password()
EndIf
EndSwitch
WEnd
EndFunc
While 1
Sleep(10)
_close()
WEnd