trunc.ate 0 Posted June 4, 2004 Is it possible to get a list of all currently active windows? I want to launch a program by script and to concentrate on that window I want to hide all other windows with the @SW_HIDE macro. When I close the new program I'd like to restore the other windows (@SW_RESTORE) as if nothing happend. Seems that everything I need is there but I'll need the window titles, therefore my question. Share this post Link to post Share on other sites
trids 2 Posted June 4, 2004 .. to concentrate on that window I want to hide all other windows ..If your goal is simply to ensure that your interaction all goes to a specific window, then have a look at the ControlSend function (and other Control* functions) .. which doesn't require you to hide any of the other windows. See helpfile for details Share this post Link to post Share on other sites
trunc.ate 0 Posted June 4, 2004 Thanks, but it's not ensuring the interaction to a specific window, it's really about me who gets easily distracted by other windows. So the goal is not functionality but beauty I just want that specific window on my desktop and all the others hidden. Share this post Link to post Share on other sites
trunc.ate 0 Posted June 9, 2004 w00t! That's even better, works like a charm. Thanks! Share this post Link to post Share on other sites
Guest TherapyClown Posted August 25, 2004 Hi all, i'm looking for the same functionality as trunc.ate and not a workaround like WinMinimizeAll() is there a way to get an array of all open windows names? thnxs... Share this post Link to post Share on other sites
Guest ChuckSB Posted May 27, 2005 (edited) I am wanting the ability to look through all the active windows and locate all instances of a specific program, then at regular send a keystroke to each instance of that program, preferably with the minimum of disturbance to the computer's operation. The program I am wanting to find all instances of has instances all with the same name and no secondary text to distinguish between the instances. My thinking is as follows: The ALT ESC keystoke will switch from one window to the next. $DesiredProgramTitle = "SomeProgame" $NextHandle = "ImpossibleHandle" Send( "!{ESC}" ); switches to the next window Sleep(5000) Opt( "WinTitleMatchMode", 4); enables you to use "active" in WinGetHandle $FirstHandle = WinGetHandle( "active"); gets the handle of the current window Dim $HandleArray[100]; for holding the handles of the desired program's instances $I = 0 While $NextHandle <> $FirstHandle If WinGetTitle("") = $DesiredProgramTitle Then $HandleArray[$I] = WinGetHandle("active") $I = $I + 1 Endif Send( "!{ESC}" ); switches to the next window Sleep(2000); give some time to react $NextHandle = WinGetHandle("active") WEnd $maxI = $I - 1 $J = 0 While 1 ControlSend("handle=" & $HandleArray[$J], "", "", "{LEFT}{RIGHT}") $J = $J + 1 If $J > $maxI Then $J = 0 Endif WEnd I am thinking this will give me an array of the handles of all the instances of the desired program and then I would send the keystrokes to the windows in the background with ControlSend. I am just starting on AutoIt. Am I making any sense? Edited May 27, 2005 by ChuckSB Share this post Link to post Share on other sites