Jump to content

msgbox focus ?


 Share

Recommended Posts

Helo all ^_^

How can I do to keep my msgbox active and always on foreground, this is what I try but it not work ...

Func _PoseQuestion()
     
     while _Question() == 2
         sleep (120000)
     WEnd
     
 EndFunc
 
 Func _Question()
     
     $Reponse = MsgBox(65,"REDEMARRAGE","Après avoir appuyé sur le bouton OK, votre poste va s'éteindre"&@CRLF&"Merci d'enregistrer votre travail avant de cliquer sur le bouton OK" & @CRLF &@CRLF&"Après avoir appuyer sur le bouton ANNULER, le message"&@CRLF&"reviendra au bout de 2 min vous rapellé qu'il faut redemarrer"& @CRLF &@CRLF & @TAB &"Sinon, votre poste s'éteindra automatiquement d'ici 5 Min" & @CRLF&@CRLF&@CRLF& "Le service Informatique",300)   
     Return $Reponse
     
 EndFunc
 
 Func _FocusMsg()
     
     while WinExists("REDEMARRAGE")
         WinActivate("REDEMARRAGE")
     WEnd
     
 EndFunc
 
 _PoseQuestion()
 _FocusMsg()
 
 
 Shutdown(9)

Winexists do not work in the same script wich contain msgbox. It works in another script, why ?

Link to comment
Share on other sites

Winexists do not work in the same script wich contain msgbox. It works in another script, why ?

Zedna has your answer for on top.

To answer your other question, your script is halted when you call a MsgBox from the same script.

So, it's not that WinExists doesn't work per se, isn't just doesn't get a chance to work.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...