Page 1 of 1

help: WinKill with loop

Posted: 22 Aug 2016, 07:50
by Tomer
Hi,

I need a script that always looking for some open window,
like location: "C:\"

and when its detected that "C:\" is open, it will kill this window and script will close.

I hope I explain myself correctly.

Thanks in advance!

Re: help: WinKill with loop

Posted: 22 Aug 2016, 09:40
by Tomer
O.k

Found it.

Answer:

Code: Select all

#Notrayicon
Loop
{

IfWinActive, libraries
{
WinKill, libraries
break
}
}
Return
This will close libraries when it will be opened.

Re: help: WinKill with loop

Posted: 22 Aug 2016, 10:40
by Guest
It is better to use WinWaitAcitve than wasting your cpu with looping.....

Re: help: WinKill with loop

Posted: 22 Aug 2016, 15:01
by Tomer
Guest wrote:It is better to use WinWaitAcitve than wasting your cpu with looping.....
Any code sample?

Re: help: WinKill with loop  Topic is solved

Posted: 22 Aug 2016, 18:50
by Shadowpheonix

Code: Select all

#Notrayicon
WinWaitActive, libraries
WinKill, libraries
ExitApp

Re: help: WinKill with loop

Posted: 23 Aug 2016, 01:05
by Tomer
Tnx Shadowpheonix :)