DraikSword Posted December 9, 2009 Share Posted December 9, 2009 Hi all. Which function can Restore windows in Taskbar for x(seconds) and then Minimize them? Can I use _WinAPI_SetWindowPos ? It used "Handle of window" but I have more than 1 window to show and then minimize, how can I create a handle_list? Link to comment Share on other sites More sharing options...
whim Posted December 9, 2009 Share Posted December 9, 2009 Which function can Restore windows in Taskbar for x(seconds) and then Minimize them? Look up GUISetState how can I create a handle_list?Look up WinListHTH,whim Link to comment Share on other sites More sharing options...
alexxh Posted December 9, 2009 Share Posted December 9, 2009 (edited) WinSetState ( "Title of the window1", "", @SW_RESTORE ) WinSetState ( "Title of the window2", "", @SW_RESTORE ) Sleep(3000) ;for 3 seconds WinSetState ( "Title of the window1", "", @SW_MINIMIZE ) WinSetState ( "Title of the window2", "", @SW_MINIMIZE ) Edited December 9, 2009 by alexxh Link to comment Share on other sites More sharing options...
picea892 Posted December 9, 2009 Share Posted December 9, 2009 #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 If BitAnd(WinGetState($aWin[$i][0],""),16) then WinSetState($aWin[$i][0],"",@SW_RESTORE) sleep(1000) WinSetState($aWin[$i][0],"",@SW_MINIMIZE) EndIf EndIf Next 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 Link to comment Share on other sites More sharing options...
DraikSword Posted December 21, 2009 Author Share Posted December 21, 2009 Thank you so much. Link to comment Share on other sites More sharing options...
jaweb Posted August 18, 2010 Share Posted August 18, 2010 #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 If BitAnd(WinGetState($aWin[$i][0],""),16) then WinSetState($aWin[$i][0],"",@SW_RESTORE) sleep(1000) WinSetState($aWin[$i][0],"",@SW_MINIMIZE) EndIf EndIf Next 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 How to tell it to Minimize Internet Explorer and/or any web browser only? Started learning about 3 days ago so the Arrays concept is beyond me. thanx. 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