seres 1 Posted September 9, 2007 hello, how do i change the value of a boolean to true if a window is not active, here is my code Global $Run = True HotKeySet("^+!s", "new") Func new() If $Run = True Then run("new") $Run = False Else winclose ("new") $Run = True endif EndFunc sometimes i close the window with alt+f4, but the $Run doesnt change to true automatically so i have to press the func again what do i have to add to make it change to true if it closes by another thing different than ^+!s Share this post Link to post Share on other sites
Generator 0 Posted September 9, 2007 Probably..... If WinExists("new") Then WinClose("new") Else Run("new") EndIf Share this post Link to post Share on other sites
seres 1 Posted September 9, 2007 i mean that when it runs the new $run becomes false so when i press the same keys it closes and becoms true but sometime i close it with alt+f4 and the $run doesnt change to true is there a form to change this value if i press alt+f4 accydentaly Share this post Link to post Share on other sites
Nahuel 1 Posted September 9, 2007 I don't really understand you but... If WinGetState("New")=8 Then $Run=Not $Run EndIf It changes the state of $Run to True if it's False or to False if it's True when the "New" window is active. Share this post Link to post Share on other sites