Sign in to follow this  
Followers 0
Vadersapien

Hide all windows?

6 posts in this topic

We can use the function WinMinimizeAll() to minimize all windows, but what if I want to hide all windows?

Is the a way to list the windows that WinMinimizeAll() affects?

Or would a seperate function have to be built?

I cannot use WinList(), since that returns other windows which aern't really windows(like gadgets)


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



You might try listing them with _WinAPI_EnumWindowsTop() instead of WinList().

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Alternatively you exclude those windows you don't want hidden

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

Alternatively you exclude those windows you don't want hidden

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

I previously used this, but because it will run on many different computers, I can't possibly put a list of every program to exclude...

In case it helps, I plan to make a Virtual Desktop app. from 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

#include <Array.au3>
#include <Constants.au3>
#include <windowsConstants.au3>

Dim $aWin = WinList(), $aWindows[1][1]
Dim $hUser32 = DllOpen('user32.dll')
Dim $iEx_Style, $iCounter = 0


For $i = 1 To $aWin[0][0]
$iEx_Style = BitAND(GetWindowLong($aWin[$i][1], $GWL_EXSTYLE), $WS_EX_TOOLWINDOW)
Local $iStyle = BitAND(WinGetState($aWin[$i][1]), 2)

If $iEx_Style <> -1 And Not $iEx_Style And $iStyle Then
ReDim $aWindows[$iCounter+1][1]
$aWindows[$iCounter][0] = $aWin[$i][0]
$iCounter += 1
EndIf
Next

_ArrayDisplay($aWindows)

DllClose($hUser32)


Func GetWindowLong($hWnd, $iIndex, $hUser = 'user32.dll')
Local $Ret = DllCall($hUser, 'int', 'GetWindowLong', 'hwnd', $hWnd, 'int', $iIndex)
If Not @error Then Return $Ret[0]
Return SetError(-1, 0, -1)
EndFunc

Share this post


Link to post
Share on other sites

#include <Array.au3>
#include <Constants.au3>
#include <windowsConstants.au3>

Dim $aWin = WinList(), $aWindows[1][1]
Dim $hUser32 = DllOpen('user32.dll')
Dim $iEx_Style, $iCounter = 0


For $i = 1 To $aWin[0][0]
$iEx_Style = BitAND(GetWindowLong($aWin[$i][1], $GWL_EXSTYLE), $WS_EX_TOOLWINDOW)
Local $iStyle = BitAND(WinGetState($aWin[$i][1]), 2)

If $iEx_Style <> -1 And Not $iEx_Style And $iStyle Then
ReDim $aWindows[$iCounter+1][1]
$aWindows[$iCounter][0] = $aWin[$i][0]
$iCounter += 1
EndIf
Next

_ArrayDisplay($aWindows)

DllClose($hUser32)


Func GetWindowLong($hWnd, $iIndex, $hUser = 'user32.dll')
Local $Ret = DllCall($hUser, 'int', 'GetWindowLong', 'hwnd', $hWnd, 'int', $iIndex)
If Not @error Then Return $Ret[0]
Return SetError(-1, 0, -1)
EndFunc

That's Perfect! Thanks!

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