Sign in to follow this  
Followers 0
seres

help

8 posts in this topic

#1 ·  Posted (edited)

hello, im new in this of auto it, what i want to do is that i have some scrip and if i press control+shift+t makes winclose of some windows and if i press control+shift+y open those closed windows and to end the scrip untill i press control+break

thanks

Edited by seres

Share this post


Link to post
Share on other sites



hello, im new in this of auto it, what i want to do is that i have some scrip and if i press control+shift+t makes winclose of some windows and if i press control+shift+y open those closed windows and to end the scrip untill i press control+break

thanks

If you want to re-open the windows once you close them, you would probably be better off just hiding them.

Here is an example.

HotKeySet("^+t", "HideWins")
HotKeySet("^+y", "ShowWins")

While 1
    Sleep(100)
WEnd
;Edit titles to the title of the windows you want to hide.
Func HideWins()
    WinSetState("Title1","", @SW_HIDE)
    WinSetState("Title2","", @SW_HIDE)
    WinSetState("Title3","", @SW_HIDE)
EndFunc

Func ShowWins()
    WinSetState("Title1","", @SW_SHOW)
    WinSetState("Title2","", @SW_SHOW)
    WinSetState("Title3","", @SW_SHOW)
EndFunc

Share this post


Link to post
Share on other sites

hi, thanks answering my cuestions, it really help me a lot , why did u put a

While 1

Sleep(100)

WEnd

i read the help file but im stills not sure of that so, can u please explain it to me

Share this post


Link to post
Share on other sites

beccause hotkeys are not actually running until you press them they are assigned but they do not call any funcs. With out the while statement, autoit will close the script when it reaches the end.

Share this post


Link to post
Share on other sites

beccause hotkeys are not actually running until you press them they are assigned but they do not call any funcs. With out the while statement, autoit will close the script when it reaches the end.

In other words, The While...WEnd loop gives the script something to do while it waits for you to press the hotkeys. Without it, The script would close almost immediately because it has nothing to do.

Share this post


Link to post
Share on other sites

In other words, The While...WEnd loop gives the script something to do while it waits for you to press the hotkeys. Without it, The script would close almost immediately because it has nothing to do.

well if you want to explain it so he can understand...

Share this post


Link to post
Share on other sites

tankyou verymuch

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  
Followers 0