help: WinKill with loop Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Tomer
Posts: 324
Joined: 21 Aug 2016, 05:11

help: WinKill with loop

22 Aug 2016, 07:50

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!
User avatar
Tomer
Posts: 324
Joined: 21 Aug 2016, 05:11

Re: help: WinKill with loop

22 Aug 2016, 09:40

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.
Guest

Re: help: WinKill with loop

22 Aug 2016, 10:40

It is better to use WinWaitAcitve than wasting your cpu with looping.....
User avatar
Tomer
Posts: 324
Joined: 21 Aug 2016, 05:11

Re: help: WinKill with loop

22 Aug 2016, 15:01

Guest wrote:It is better to use WinWaitAcitve than wasting your cpu with looping.....
Any code sample?
Shadowpheonix
Posts: 1259
Joined: 16 Apr 2015, 09:41

Re: help: WinKill with loop  Topic is solved

22 Aug 2016, 18:50

Code: Select all

#Notrayicon
WinWaitActive, libraries
WinKill, libraries
ExitApp
User avatar
Tomer
Posts: 324
Joined: 21 Aug 2016, 05:11

Re: help: WinKill with loop

23 Aug 2016, 01:05

Tnx Shadowpheonix :)

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, Google [Bot], hasantr and 44 guests