I wanted to contribute with my AnimateWindow UDF.
I like the AnimateWindow DLLCall, cause it makes my scripts look
You need a Beta wich supports DLLCall to use it.
;CONSTANTS Global Const $AW_FADE_IN = 0x00080000;fade-in Global Const $AW_FADE_OUT = 0x00090000;fade-out Global Const $AW_SLIDE_IN_LEFT = 0x00040001;slide in from left Global Const $AW_SLIDE_OUT_LEFT = 0x00050002;slide out to left Global Const $AW_SLIDE_IN_RIGHT = 0x00040002;slide in from right Global Const $AW_SLIDE_OUT_RIGHT = 0x00050001;slide out to right Global Const $AW_SLIDE_IN_TOP = 0x00040004;slide-in from top Global Const $AW_SLIDE_OUT_TOP = 0x00050008;slide-out to top Global Const $AW_SLIDE_IN_BOTTOM = 0x00040008;slide-in from bottom Global Const $AW_SLIDE_OUT_BOTTOM = 0x00050004;slide-out to bottom Global Const $AW_DIAG_SLIDE_IN_TOPLEFT = 0x00040005;diag slide-in from Top-left Global Const $AW_DIAG_SLIDE_OUT_TOPLEFT = 0x0005000a;diag slide-out to Top-left Global Const $AW_DIAG_SLIDE_IN_TOPRIGHT = 0x00040006;diag slide-in from Top-Right Global Const $AW_DIAG_SLIDE_OUT_TOPRIGHT = 0x00050009;diag slide-out to Top-Right Global Const $AW_DIAG_SLIDE_IN_BOTTOMLEFT = 0x00040009;diag slide-in from Bottom-left Global Const $AW_DIAG_SLIDE_OUT_BOTTOMLEFT = 0x00050006;diag slide-out to Bottom-left Global Const $AW_DIAG_SLIDE_IN_BOTTOMRIGHT = 0x0004000a;diag slide-in from Bottom-right Global Const $AW_DIAG_SLIDE_OUT_BOTTOMRIGHT = 0x00050005;diag slide-out to Bottom-right Global Const $AW_EXPLODE = 0x00040010;explode Global Const $AW_IMPLODE = 0x00050010;implode Func _WinAnimate($v_gui, $i_mode, $i_duration = 1000) If @OSVersion = "WIN_XP" OR @OSVersion = "WIN_2000" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", WinGetHandle($v_gui), "int", $i_duration, "long", $i_mode) Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError') If $ai_gle[0] <> 0 Then SetError(1) Return 0 EndIf Return 1 EndIf EndFunc;==> _WinAnimate() #cs DEMO - For lazy guys like me - to copy paste $hwnd = GUICreate("AnimateWindow - Demo", 300, 300) _WinAnimate($hwnd, $AW_FADE_IN) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_FADE_OUT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_IN_LEFT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_OUT_LEFT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_IN_RIGHT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_OUT_RIGHT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_IN_TOP) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_OUT_TOP) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_IN_BOTTOM) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_SLIDE_OUT_BOTTOM) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_TOPLEFT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_TOPLEFT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_TOPRIGHT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_TOPRIGHT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_BOTTOMLEFT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_BOTTOMLEFT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_BOTTOMRIGHT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_BOTTOMRIGHT) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_EXPLODE) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) Sleep(1500) _WinAnimate($hwnd, $AW_IMPLODE) ConsoleWrite('er: ' & @error & @LF & 'ex: ' & @extended & @CRLF) #ce
Copy it to the Include directory of your AutoIt installation.
Include it to your script like this:
#Include <_WinAnimate.au3>
Then you can call the function like this:
_WinAnimate($gui,$mode[,$duration])
Parameters:
Where $gui is a valid GUI/WindowHandle or Title created by GUICreate or from WinGetHandle() or just a Titlename.
$mode is one of the following:
$AW_FADE_IN ;fade-in
$AW_FADE_OUT ;fade-out
$AW_SLIDE_IN_LEFT ;slide in from left
$AW_SLIDE_OUT_LEFT ;slide out to left
$AW_SLIDE_IN_RIGHT ;slide in from right
$AW_SLIDE_OUT_RIGHT ;slide out to right
$AW_SLIDE_IN_TOP ;slide-in from top
$AW_SLIDE_OUT_TOP ;slide-out to top
$AW_SLIDE_IN_BOTTOM ;slide-in from bottom
$AW_SLIDE_OUT_BOTTOM ;slide-out to bottom
$AW_DIAG_SLIDE_IN_TOPLEFT ;diag slide-in from Top-left
$AW_DIAG_SLIDE_OUT_TOPLEFT ;diag slide-out to Top-left
$AW_DIAG_SLIDE_IN_TOPRIGHT ;diag slide-in from Top-Right
$AW_DIAG_SLIDE_OUT_TOPRIGHT ;diag slide-out to Top-Right
$AW_DIAG_SLIDE_IN_BOTTOMLEFT ;diag slide-in from Bottom-left
$AW_DIAG_SLIDE_OUT_BOTTOMLEFT ;diag slide-out to Bottom-left
$AW_DIAG_SLIDE_IN_BOTTOMRIGHT ;diag slide-in from Bottom-right
$AW_DIAG_SLIDE_OUT_BOTTOMRIGHT ;diag slide-out to Bottom-right
$AW_EXPLODE ;explode
$AW_IMPLODE ;implode
$duration is the duration in miliseconds which the animation should last. The lower the duration, the faster is the animation. $duration is optional.
Edit: Updated the UDF-code of the first post (I hate to scroll down to search for the most actual version)
Edited by Raindancer, 29 August 2005 - 02:55 PM.







