Jump to content
Sign in to follow this  

Loopy about Windows

Recommended Posts

How can I get Autoit to show me a list of all active window titles?

Would it be a combination of WinExists and a loop?

I have a program that opens multiple windows and I would like Autoit to show me which windows are open (by title) and then the user can activate a window that may be hidden behind another.

Share this post

Link to post
Share on other sites

Thanks. It works quite well.

My final script goes something like this:

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$mainwindow = GUICreate("Activate", 179.25, 245.25)


GUICtrlCreateLabel("Select window to" & @LF & "activate.", 1, 1)

$okbutton = GUICtrlCreateButton("Activate",100 , 1, 60)

GUICtrlSetOnEvent($okbutton, "OKButton")

$mylist = GuiCtrlCreateList("", 1, 26, 170, 200)

$var = WinList()

For $i = 1 to $var[0][0]

If $var[$i][0] <> "" AND IsVisible($var[$i][1]) and $var[$i][0] <> "Activate" Then





While 1

Sleep(1000) ; Idle around


Func OKButton()

WinActivate(GUICtrlRead($mylist)) ;activate selected window

Exit ;end program


Func CLOSEClicked()

Exit ;end program


Func IsVisible($handle)

;checks if window is a visible window

If BitAnd( WinGetState($handle), 2 ) Then

Return 1


Return 0



Check the helpfile for WinList()


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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...