babou Posted April 23, 2009 Share Posted April 23, 2009 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 More sharing options...
Zedna Posted April 23, 2009 Share Posted April 23, 2009 MsgBox has top-most attribute set MsgBox(1+262144,"Test","Text") Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ResNullius Posted April 23, 2009 Share Posted April 23, 2009 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 More sharing options...
babou Posted April 27, 2009 Author Share Posted April 27, 2009 thanks, it work very well Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now