Jump to content
Sign in to follow this  
lafafmentvotre

Exit loop

Recommended Posts

Hello

Is it posible to close a GUI after a specific time ?

I want to close it after 5 secondes (for exemple) if the user dont't click on the button of my gui

like this :

#include <GUIConstants.au3>
$begin = TimerInit()
If ProcessExists("winlogon.exe") Then
    $m1 = "LA MISE A JOUR SHOWCASE QUERY 7 EST TERMINEE"
    $m2 = "NOUS VOUS INVITONS A REDEMARRER VOTRE ORDINATEUR"
    $m3 = "AVANT DE REUTILISER ""EXCEL"" ET ""QUERY"""
    $m4 = "MERCI POUR VOTRE PARTICIPATION"
    $m5 = "MERCI POUR VOTRE PARTICIPATION"
    $m6 = "MERCI POUR VOTRE PARTICIPATION"

GUICreate("  Fin de mise à jour Showcase Query 7", 450, 300, -1, -1, $WS_POPUPWINDOW)

$label1 = GUICtrlCreateLabel($m1, 80, 20)
$label2 = GUICtrlCreateLabel($m2, 60, 60)
$label3 = GUICtrlCreateLabel($m3, 90, 80)
$label4 = GUICtrlCreateLabel($m4, 120, 150)


$buttonreboot = GuiCtrlCreateButton("Redémarrer", 90, 200, 85, 40,$BS_DEFPUSHBUTTON)
$buttonexit = GuiCtrlCreateButton("Annuler", 250, 200, 85, 40,)

GUISetState()

While 1

    $listener = GUIGetMsg()
    If $listener = $GUI_EVENT_CLOSE or $listener = $buttonexit Then ExitLoop
        
    ;If $listener = $buttonreboot Then Shutdown(6)
    
WEnd
    

EndIf

Thanks for your help

Share this post


Link to post
Share on other sites

I test it but my $buttonexit doesn't work with :

#include <GUIConstants.au3>
$begin = TimerInit()
If ProcessExists("winlogon.exe") Then
    $m1 = "LA MISE A JOUR SHOWCASE QUERY 7 EST TERMINEE"
    $m2 = "NOUS VOUS INVITONS A REDEMARRER VOTRE ORDINATEUR"
    $m3 = "AVANT DE REUTILISER ""EXCEL"" ET ""QUERY"""
    $m4 = "MERCI POUR VOTRE PARTICIPATION"
    $m5 = "MERCI POUR VOTRE PARTICIPATION"
    $m6 = "MERCI POUR VOTRE PARTICIPATION"

GUICreate("  Fin de mise à jour Showcase Query 7", 450, 300, -1, -1, $WS_POPUPWINDOW)

$label1 = GUICtrlCreateLabel($m1, 80, 20)
$label2 = GUICtrlCreateLabel($m2, 60, 60)
$label3 = GUICtrlCreateLabel($m3, 90, 80)
$label4 = GUICtrlCreateLabel($m4, 120, 150)


$buttonreboot = GuiCtrlCreateButton("Redémarrer", 90, 200, 85, 40,$BS_DEFPUSHBUTTON)
$buttonexit = GuiCtrlCreateButton("Annuler", 250, 200, 85, 40,)

GUISetState()

While 1
    $listener = GUIGetMsg()
    $begin = TimerInit()

    If $listener = $GUI_EVENT_CLOSE or $listener = $buttonexit Then ExitLoop
        
    ;If $listener = $buttonreboot Then Shutdown(6)
    
    sleep(5000)
    $dif = TimerDiff($begin)
    If $dif > 3000 Then ExitLoop
        
WEnd
    

EndIf

Share this post


Link to post
Share on other sites

I test it but my $buttonexit doesn't work with :

#include <GUIConstants.au3>
$begin = TimerInit()
If ProcessExists("winlogon.exe") Then
    $m1 = "LA MISE A JOUR SHOWCASE QUERY 7 EST TERMINEE"
    $m2 = "NOUS VOUS INVITONS A REDEMARRER VOTRE ORDINATEUR"
    $m3 = "AVANT DE REUTILISER ""EXCEL"" ET ""QUERY"""
    $m4 = "MERCI POUR VOTRE PARTICIPATION"
    $m5 = "MERCI POUR VOTRE PARTICIPATION"
    $m6 = "MERCI POUR VOTRE PARTICIPATION"

GUICreate("  Fin de mise à jour Showcase Query 7", 450, 300, -1, -1, $WS_POPUPWINDOW)

$label1 = GUICtrlCreateLabel($m1, 80, 20)
$label2 = GUICtrlCreateLabel($m2, 60, 60)
$label3 = GUICtrlCreateLabel($m3, 90, 80)
$label4 = GUICtrlCreateLabel($m4, 120, 150)
$buttonreboot = GuiCtrlCreateButton("Redémarrer", 90, 200, 85, 40,$BS_DEFPUSHBUTTON)
$buttonexit = GuiCtrlCreateButton("Annuler", 250, 200, 85, 40,)

GUISetState()

While 1
    $listener = GUIGetMsg()
    $begin = TimerInit()

    If $listener = $GUI_EVENT_CLOSE or $listener = $buttonexit Then ExitLoop
        
    ;If $listener = $buttonreboot Then Shutdown(6)
    
    sleep(5000)
    $dif = TimerDiff($begin)
    If $dif > 3000 Then ExitLoop
        
WEnd
    

EndIfoÝ÷ Ûú®¢×z÷«¦ëZ²W¦)Úë,j¥¢m+,¥w
+«­¢+Ø(ÀÌØí¥¸ôQ¥µÉ%¹¥Ð ¤)]¡¥±Ä($ÀÌØí±¥ÍѹÈôU%Ñ5Í ¤((%%ÀÌØí±¥ÍѹÈôÀÌØíU%}Y9Q}
1=M½ÈÀÌØí±¥ÍѹÈôÀÌØíÕÑѽ¹á¥ÐQ¡¸á¥Ñ1½½À($$($í%ÀÌØí±¥ÍѹÈôÀÌØíÕÑѽ¹É½½ÐQ¡¸M¡Õѽݸ ؤ($(%%Q¥µÉ¥ ÀÌØí¥¸¤ÐìÌÀÀÀQ¡¸á¥Ñ1½½À($$)]¹

:whistle:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...