Undine Posted August 3, 2009 Posted August 3, 2009 hi does anybody know how i can minimize all visible windows correctly? the usual SW_MINIMIZE can unfortunately not minimize some programs correctly (for example Teamspeak) when i minimize them with AutoIT then: - the program gets very small - only the titlebar is left of it - the program is positioned just above the taskbar instead of being minimized i'd be really glad if someone could provide a working script for that i just want to minimize all visible programs without any fancy stuff like restoring need this for litestep >_<
Info Posted August 3, 2009 Posted August 3, 2009 (edited) WinMinimizeAll() Do If WinGetTitle("") = Not "" Then WinSetState("","",@SW_MINIMIZE) Until WinGetTitle("") = "" Edited August 3, 2009 by Info
Undine Posted August 3, 2009 Author Posted August 3, 2009 (edited) WinMinimizeAll() Do If WinGetTitle("") = Not "" Then WinSetState("","",@SW_MINIMIZE) Until WinGetTitle("") = "" sorry but these two are not what i'm looking for WinMinimizeAll() this only works as a minimize/restore toggle and it only works together with windows explorer Do If WinGetTitle("") = Not "" Then WinSetState("","",@SW_MINIMIZE) Until WinGetTitle("") = "" this one somehow doesn't minimize for me and seeing SW_MINIMIZE it probably wouldn't work correctly for some programs Edited August 3, 2009 by Undine
Ascend4nt Posted August 3, 2009 Posted August 3, 2009 Something like this work? $aWinList=WinList() For $i=1 to $aWinList[0][0] If $aWinList[$i][0]<>"Program Manager" And $aWinList[$i][0]<>"Start" And _ BitAND(WinGetState($aWinList[$i][1]),3)=3 Then WinSetState($aWinList[$i][1],"",@SW_MINIMIZE) Next My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
somdcomputerguy Posted August 3, 2009 Posted August 3, 2009 Does this suffice? Remarks Send("#m") is a possible alternative. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
picea892 Posted August 3, 2009 Posted August 3, 2009 hidoes anybody know how i can minimize all visible windows correctly?the usual SW_MINIMIZE can unfortunately not minimize some programs correctly (for example Teamspeak)when i minimize them with AutoIT then:- the program gets very small- only the titlebar is left of it- the program is positioned just above the taskbar instead of being minimizedi'd be really glad if someone could provide a working script for thati just want to minimize all visible programs without any fancy stuff like restoringneed this for litestep >_<HiThe behaviour you describe above is the same behaviour one would experience if you tried to minimize a program after you have killed explorer.exe. The programs minimize the same as Windows 3.1 did because there is no traybar when explorer.exe is killed. I am guessing that "Teamspeak" can not be minimized to taskbar, it must usually be minimized to tray or not usually be minimized. In the case you have described I think you need to either move the window off screen or set to invisible. It will serve the same function.Autoit can minimize all normal windows. (Winamp may be an exception also)
Undine Posted August 3, 2009 Author Posted August 3, 2009 (edited) Something like this work? $aWinList=WinList() For $i=1 to $aWinList[0][0] If $aWinList[$i][0]<>"Program Manager" And $aWinList[$i][0]<>"Start" And _ BitAND(WinGetState($aWinList[$i][1]),3)=3 Then WinSetState($aWinList[$i][1],"",@SW_MINIMIZE) Next this one also doesn't minimize some programs correctly and its really really slow Hi The behaviour you describe above is the same behaviour one would experience if you tried to minimize a program after you have killed explorer.exe. The programs minimize the same as Windows 3.1 did because there is no traybar when explorer.exe is killed. I am guessing that "Teamspeak" can not be minimized to taskbar, it must usually be minimized to tray or not usually be minimized. In the case you have described I think you need to either move the window off screen or set to invisible. It will serve the same function. Autoit can minimize all normal windows. (Winamp may be an exception also) currently i'm just using the normal windows explorer for testing also even when i let the program be in the taskbar it still isn't minimized correctly everything works only when i manually click the minimize button @SW_HIDE Instead of @SW_MINIMIZE ? hide literary hides everything >_< Does this suffice? hm i don't know i've read with _SendMessage or something its possible to minimize programs the same way as the minimize button does however i couldn't really figure out how to do it no programmer Edited August 3, 2009 by Undine
Ascend4nt Posted August 3, 2009 Posted August 3, 2009 Just installed this on a test rig. It doesn't 'minimize' at all when you click the minimize button - it goes into the system tray. The minimize messages aren't handled correctly by the program, that'd be my guess - since every other program I've run allowed minimizing in the normal fashion. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Undine Posted August 4, 2009 Author Posted August 4, 2009 yes that's also what i think about 95% of my programs work just fine only a few special ones (that i unfortunately need) bug out every time stuff like Set_Affinity_II can't even return to its normal size again and needs to be restarted... but on the other hand the minimize button always works error-free for me i wish could just send "minimize button was pressed" to these programs instead of the SW_MINIMIZE which fails to work for them
somdcomputerguy Posted August 4, 2009 Posted August 4, 2009 (edited) You could use the AutoIt Info Tool to get the info, like coords or classname, then ControlClick the minimize button.. Edited August 4, 2009 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Ascend4nt Posted August 4, 2009 Posted August 4, 2009 (edited) It might be possible with a DLLCall or WinMenuSelectItem to choose 'minimize' from the system menu, but I'm waiting on a response from the person in the topic Selecting item from system menu. Seems they found a way to do it.(another option would be to send keystrokes like Alt-Space and choosing the minimize menu item that way, but I believe the Window would have to be in the foreground (WinActivate))*edit: actually, don't have much time to look (on my way out), but there's a few UDF functions in <GuiMenu.au3> worth exploring, one being _GUICtrlMenu_GetSystemMenu()... will have to explore that later Edited August 4, 2009 by Ascend4nt My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Ascend4nt Posted August 5, 2009 Posted August 5, 2009 Undine, this should work: #include <WinAPI.au3> $hWnd=WinGetHandle("TeamSpeak 2") ; SYS_COMMAND=0x112, SC_MINIMIZE = 0xF020 _WinAPI_PostMessage($hWnd,0x112,0xF020,0) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Undine Posted August 5, 2009 Author Posted August 5, 2009 Undine, this should work: #include <WinAPI.au3> $hWnd=WinGetHandle("TeamSpeak 2") ; SYS_COMMAND=0x112, SC_MINIMIZE = 0xF020 _WinAPI_PostMessage($hWnd,0x112,0xF020,0) wow this works perfectly! even with "Set Affinity II" which has its minimize button disabled >_< the rest should be easy now thanks a lot
Ascend4nt Posted August 5, 2009 Posted August 5, 2009 @Undine np. By the way, I thought when you mentioned 'Set Affinity II', that you were actually using Task Manager to change the Affinity for different processes, which confused me. Just out of curiosity - does using that program to set the Affinity level actually help anything? I would think that you'd want to keep most programs at the default, seeing as how a large number of programs have multiple threads. For example, they put a screenshot where they set the Affinity level for Firefox on one CPU/logical core - I'd bet that would slow down firefox. Currently, with firefox running, I have 16 threads going (with just 3 tabs open). Windows would spread those out most likely across different cpu's. In fact, I just looked through all the running processes on my Windows XP installation, and only one program (unlocker) has just a single thread going (you can view Threads in Task Manager with View->Select Columns). I would think it's probably best to set the Priority level rather then the Affinity level for most programs... but I digress.. >_< Just glad that sending that minimize command worked well for ya! My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Undine Posted August 5, 2009 Author Posted August 5, 2009 @Undinenp. By the way, I thought when you mentioned 'Set Affinity II', that you were actually using Task Manager to change the Affinity for different processes, which confused me. Just out of curiosity - does using that program to set the Affinity level actually help anything? I would think that you'd want to keep most programs at the default, seeing as how a large number of programs have multiple threads. For example, they put a screenshot where they set the Affinity level for Firefox on one CPU/logical core - I'd bet that would slow down firefox. Currently, with firefox running, I have 16 threads going (with just 3 tabs open). Windows would spread those out most likely across different cpu's. In fact, I just looked through all the running processes on my Windows XP installation, and only one program (unlocker) has just a single thread going (you can view Threads in Task Manager with View->Select Columns). I would think it's probably best to set the Priority level rather then the Affinity level for most programs... but I digress.. Just glad that sending that minimize command worked well for ya!yes limiting normal programs to 1 specific core probably wouldn't help muchwhere doing this really helps are gaming applicationscertain game engines can't handle more than 1 core correctlythis results in noticeable framedrops and mini-lagsbut limited to 1 core the framerate stays very stable >_<
Ascend4nt Posted August 5, 2009 Posted August 5, 2009 yes limiting normal programs to 1 specific core probably wouldn't help muchwhere doing this really helps are gaming applicationscertain game engines can't handle more than 1 core correctlythis results in noticeable framedrops and mini-lagsbut limited to 1 core the framerate stays very stable >_< Ahh - good to know... I hadn't tried it with games - though many modern-day games use threading too. For older or simpler games though, I can see it being useful. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
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