olo Posted May 2, 2013 Share Posted May 2, 2013 Hey all, Ive tried the help file. but ive come up with no luck. Im trying to minimize multiple windows of the same name. So say I have 5 firefox windows open. And 3 of them are just the starting page. I wanna minimize all 3 that are on the starting page. But keep the other 2 open as then will be on different websites so will have different titles. #include-once Func MinWindowByClass($Classname) If WinExists($Classname) Then Return 1 Else Return WinSetState("[CLASS:" & $Classname & "]", "", @SW_MINIMIZE) EndIf EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #include <..\Library\Minimize specific window.au3> Func Test_MinSpecWin() local $Classname = "MozillaWindowClass" MinWindowByClass($Classname) local $state = WinGetState("[CLASS:" & $Classname & "]") if BitAND($state, 16) then return 1 Else return 0 endif EndFunc Link to comment Share on other sites More sharing options...
jdelaney Posted May 2, 2013 Share Posted May 2, 2013 (edited) pick your poison: $aWindows = WinList("[CLASS:AcrobatSDIWindow]") For $i = 1 To UBound($aWindows)-1 If Not BitAND(WinGetState($aWindows[$i][1]), 16) Then WinSetState ($aWindows[$i][1], "", @SW_MINIMIZE) Next $iCounter = 1 $hwnd = WinGetHandle("[CLASS:AcrobatSDIWindow; INSTANCE:" & $iCounter & "]") While IsHWnd($hwnd) If Not BitAND(WinGetState($hwnd), 16) Then WinSetState ($hwnd, "", @SW_MINIMIZE) $iCounter+=1 $hwnd = WinGetHandle("[CLASS:AcrobatSDIWindow; INSTANCE:" & $iCounter & "]") WEnd Edited May 2, 2013 by jdelaney olo 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
olo Posted May 2, 2013 Author Share Posted May 2, 2013 Wow thanks very much!! Much appreciated Link to comment Share on other sites More sharing options...
jdelaney Posted May 2, 2013 Share Posted May 2, 2013 (edited) Oh, only half read your need...you can add TITLE:|REGEXPTITLE: into the []:Or, add an additional step in each loop...WinGetTitle, and check if it matches your string...else skip the minimizeTITLE - Window titleCLASS - The internal window classnameREGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)LAST - Last window used in a previous AutoIt commandACTIVE - Currently active windowX Y W H - The position and size of a windowINSTANCE - The 1-based instance when all given properties match Edited May 2, 2013 by jdelaney olo 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
olo Posted May 3, 2013 Author Share Posted May 3, 2013 Oh, only half read your need...you can add TITLE:|REGEXPTITLE: into the []: Or, add an additional step in each loop...WinGetTitle, and check if it matches your string...else skip the minimizeTITLE - Window titleCLASS - The internal window classnameREGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)LAST - Last window used in a previous AutoIt commandACTIVE - Currently active windowX Y W H - The position and size of a windowINSTANCE - The 1-based instance when all given properties match I knew I had to loop it somehow just wasnt sure what way to go about it. Link to comment Share on other sites More sharing options...
olo Posted May 3, 2013 Author Share Posted May 3, 2013 (edited) Oh, only half read your need...you can add TITLE:|REGEXPTITLE: into the []: Or, add an additional step in each loop...WinGetTitle, and check if it matches your string...else skip the minimizeTITLE - Window titleCLASS - The internal window classnameREGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)LAST - Last window used in a previous AutoIt commandACTIVE - Currently active windowX Y W H - The position and size of a windowINSTANCE - The 1-based instance when all given properties match like this? $aWindows = WinList("[CLASS:|REGEXPCLASS" & $Classname & "]") Edited May 3, 2013 by olo Link to comment Share on other sites More sharing options...
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