Jump to content
Sign in to follow this  
seres

help

Recommended Posts

seres

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

Probably.....

If WinExists("new") Then
WinClose("new")
Else
Run("new")
EndIf

Share this post


Link to post
Share on other sites
seres

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

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.