Sign in to follow this  
Followers 0
Vadersapien

Can I use WinList() to only get applications in the taskbar?

4 posts in this topic

I've been trying to get WinList() to get all the open windows and Minimize/Maximize/Hide them...problem is, it picks up everything like the "Program Manager" and my sidebar gadgets, but I only want Minimize/Maximize/Hide windows that are in the taskbar. How can I do this?


Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.

Share this post


Link to post
Share on other sites



Use WinGetState & other WinGet... funcs to postprocess the list obtained with WinList

you might also want to take a look at GaryFrost's Taskbar Fun and see if you can press (parts of) that into service for your purposes.

hth,

whim

Share this post


Link to post
Share on other sites

#include <Process.au3>
#Include <WinAPI.au3>
$winlist=_getwinlist()
for $i= 1 to $winlist[0][1]
    WinSetState($winlist[$i][2],"",@SW_MINIMIZE)
Next

func _getwinlist ()
Local $sExclude_List = "|Start[CL:102939]|Start|Desktop|Start Menu[CL:102938]|taskbar|iconwin|desktop[CL:102937]|Program Manager|taskbar|Menu|Save As|Drag|maincontext|context|"
Local $sExclude_class = "|tooltips_class32|gdkWindowToplevel|gdkWindowTempShadow|TaskSwitcherWnd|gdkWindowTemp|bosa_sdm_Microsoft Office Word 11.0|MsoCommandBarPopup|MsoCommandBarShadow|NUIDialog|CallTip|ThumbnailClass|#32770|Desktop User Picture|OfficeTooltip|"
Local $Listit
Local $aWinList = WinList()
dim $Listit[$aWinList[0][0]][5]
;Count windows

For $i = 1 To $aWinList[0][0]
;Only display visible windows that have a title
    If $aWinList[$i][0] = "" Or Not BitAND(WinGetState($aWinList[$i][1]), 2) Then ContinueLoop
;Add to array all win titles that is not in the exclude list
        $class = _WinAPI_GetClassName($aWinList[$i][1])
    If Not StringInStr($sExclude_List, "|" & $aWinList[$i][0] & "|") and Not StringInStr($sExclude_class, "|" & $class & "|") Then
        $Listit[0][1]=$Listit[0][1]+1
        $Listit[$Listit[0][1]][0]= _ProcessGetName (WinGetProcess($aWinList[$i][1]))
        $Listit[$Listit[0][1]][1]= $aWinList[$i][0]
        $Listit[$Listit[0][1]][2]= $aWinList[$i][1]
        $Listit[$Listit[0][1]][3]= $class
    EndIf
Next
ReDim $Listit[$Listit[0][1]+1][5]
return $Listit
EndFunc

Share this post


Link to post
Share on other sites

That code works well...but rocketdock and the sidebar (and gadgets) minimize themselves (partly) and mess up...any way to fix this?


Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.

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