Sign in to follow this  
Followers 0
yton

close multiple firefox windows

6 posts in this topic

Greetings,

Opt("WinTitleMatchMode", 2)
If WinExists("Firefox") Then
    $hwnd = WinGetHandle("Firefox")
    WinClose($hwnd)
EndIf

it works for 1 window only

what changes should I do in order to close multiple firefox windows?

thank you

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2)
$aList = WinList("Firefox")
For $i = 1 To $aList[0][0]
    WinClose($aList[$i][1])
Next


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

thank you so much )

Share this post


Link to post
Share on other sites

how to close all except first one 

Share this post


Link to post
Share on other sites

Just use

For $i = 2 To $aList[0][0]

instead of

For $i = 1 To $aList[0][0]

then the first firefox in the list will not be closed.

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