mabriseb Posted July 12, 2005 Share Posted July 12, 2005 I would like to freeze my GUI for the time that a file exist and when the file has been deleted the GUI is enable again. I tried the script below but it's not working $sortie = 0 GUISetState (@SW_DISABLE) Do $test = FileExists(@ScriptDir & "\List\1.txt") If $Test = 1 Then Else $Sortie = 1 EndIf until $Sortie = 0 GUISetState (@SW_ENABLE) MatMontreal, Canada Link to comment Share on other sites More sharing options...
buzz44 Posted July 12, 2005 Share Posted July 12, 2005 While FileExists(@ScriptDir & "\List\1.txt") GUISetState (@SW_DISABLE) Wend GUISetState (@SW_ENABLE) qq Link to comment Share on other sites More sharing options...
LxP Posted July 12, 2005 Share Posted July 12, 2005 If you find that the above code makes your CPU crazy (I haven't tried it but it looks like it may) then you may prefer this code: guiSetState(@SW_DISABLE) while (fileExists(@scriptDir & "\list\1.txt")) sleep(250) wEnd guiSetState(@SW_ENABLE) Link to comment Share on other sites More sharing options...
buzz44 Posted July 12, 2005 Share Posted July 12, 2005 (edited) Yeah I was thinking that LxP , I was going to consider changing it to what you have above or something like below, but your's seems to be less complicated. $Temp = 0 While FileExists(@ScriptDir & "\List\1.txt") If $Temp = 0 Then GUISetState (@SW_DISABLE) $Temp = 1 Wend GUISetState (@SW_ENABLE) Edited July 12, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
mabriseb Posted July 12, 2005 Author Share Posted July 12, 2005 Thanks!!! It's working without put the sleep command but maybe I will use it on my old computer where this script will be use MatMontreal, Canada 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