Ebola57 Posted February 25, 2020 Share Posted February 25, 2020 (edited) Hi community Is there a way to minimize all active Windows BUT the AU3 running script ? Tried this without success WinMinimizeAll ( ) $hWnd = WinGetHandle ( "My_AU3_To_Keep" ) ; Does not work WinSetState ( $hWnd , "", @SW_RESTORE ) ; Does not work WinActivate ( $hWnd ) ; Does not work _WinAPI_SetForegroundWindow ( $hWnd ) _WinAPI_SetActiveWindow ( $hWnd ) _WinAPI_SwitchToThisWindow ( $hWnd ) WinGetState of my AU3 is 23 ( $WIN_STATE_MINIMIZED + $WIN_STATE_ENABLED + $WIN_STATE_VISIBLE + $WIN_STATE_EXISTS ) Regards Edited February 25, 2020 by Ebola57 Link to comment Share on other sites More sharing options...
Ebola57 Posted February 25, 2020 Author Share Posted February 25, 2020 (edited) It looks like going in minimized state take "some time", and I can't send an immediate restore call after minimizing This dirty code patch the problem, but can't imagine there's nothing better to do ... $hWnd = WinGetHandle ( "My_AU3_To_Keep" ) WinMnimizeAll ( ) While 1 If $WinGetState ( $hWnd ) == 23 Then WinActivate ( $hWnd ) ExitLoop EndIf WEnd Edited February 25, 2020 by Ebola57 Link to comment Share on other sites More sharing options...
seadoggie01 Posted February 29, 2020 Share Posted February 29, 2020 Seems that you need a small sleep in your script... WinMinimizeAll() Sleep(100) WinSetState($hWnd, "", @SW_RESTORE) Ebola57 1 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types 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