mocambique Posted November 8, 2007 Posted November 8, 2007 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.
Developers Jos Posted November 8, 2007 Developers Posted November 8, 2007 Check the helpfile for WinList() SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
mocambique Posted November 13, 2007 Author Posted November 13, 2007 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) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") 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 GUICtrlSetData($mylist,$var[$i][0]) EndIf Next GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func OKButton() WinActivate(GUICtrlRead($mylist)) ;activate selected window Exit ;end program EndFunc Func CLOSEClicked() Exit ;end program EndFunc Func IsVisible($handle) ;checks if window is a visible window If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Check the helpfile for WinList()
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now