Jump to content

Closing all windows


 Share

Recommended Posts

I have this code sample I found on the web, for some reason I get two prompts to the Log Off window, after these two are gone the windows all get closed which is a good thing. I'm just wondering how I should get rid of those two window prompts, here's the code :

Func killAllWindows()

    $WinListArr = WinList()

    For $i = 1 To $WinListArr[0][0]
            If WinVisible($WinListArr[$i][1]) Then WinClose($WinListArr[$i][1])
    Next

    
EndFunc

Func WinVisible($Title, $Text="")
    Return BitAnd(WinGetState($Title, $Text), 2)
EndFunc

killAllWindows()
Link to comment
Share on other sites

I'd start by getting the script to show you all the open windows contained in $WinListArr... There may be a couple of windows you'll need to exclude from the close process.

Are you telling me something I need to know or something I want to know?

Link to comment
Share on other sites

I'd start by getting the script to show you all the open windows contained in $WinListArr... There may be a couple of windows you'll need to exclude from the close process.

Yeah I went too fast, only checked the content of [1] instead of [0] so I was seeing their address instead of the titles. Decided to change the code so that it could take an array of exclusions.

Thanks mate.

For some reason Program Manager was in the list of windows to close.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...