Sign in to follow this  
Followers 0
Undine

How to minimize all visible windows correctly

17 posts in this topic

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 >_<

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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 by Undine

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 >_<

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)

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by Undine

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

You could use the AutoIt Info Tool to get the info, like coords or classname, then ControlClick the minimize button..

Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#12 ·  Posted (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 by Ascend4nt

Share this post


Link to post
Share on other sites

Undine, this should work:

#include <WinAPI.au3>
$hWnd=WinGetHandle("TeamSpeak 2")
; SYS_COMMAND=0x112, SC_MINIMIZE = 0xF020
_WinAPI_PostMessage($hWnd,0x112,0xF020,0)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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!

Share this post


Link to post
Share on other sites

@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!

yes limiting normal programs to 1 specific core probably wouldn't help much

where doing this really helps are gaming applications

certain game engines can't handle more than 1 core correctly

this results in noticeable framedrops and mini-lags

but limited to 1 core the framerate stays very stable >_<

Share this post


Link to post
Share on other sites

yes limiting normal programs to 1 specific core probably wouldn't help much

where doing this really helps are gaming applications

certain game engines can't handle more than 1 core correctly

this results in noticeable framedrops and mini-lags

but 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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0