Raindancer Posted June 7, 2005 Share Posted June 7, 2005 (edited) Hola ScriptersI 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.expandcollapse popup;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) #ceCopy 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 August 29, 2005 by Raindancer Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer Link to comment Share on other sites More sharing options...
MHz Posted June 7, 2005 Share Posted June 7, 2005 Very nice layout. Have you looked into the concept of how a borderless window can slide out of a parent window? This would be a nice trick. If you have a nVidia control panel, the settings window, slides out. This example works from the centre only. Link to comment Share on other sites More sharing options...
w0uter Posted June 7, 2005 Share Posted June 7, 2005 (edited) pretty sweet. keep it up. changed: function name to _WinAnimate. added: real consts. some error handeling. made it accept both Titles & Handels._WinAnimate.au3 Edited June 7, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted June 7, 2005 Share Posted June 7, 2005 (edited) Very nice layout.Have you looked into the concept of how a borderless window can slide out of a parent window? This would be a nice trick. If you have a nVidia control panel, the settings window, slides out. This example works from the centre only.<{POST_SNAPBACK}>Where abouts in the nVidia Control Panel? I can't find it.Did you mean something like this? Excuse the lameness/messiness I done it in a rush lol.#include <GUIConstants.au3> $gui = GUICreate("My GUI", 200, 200, 20, 20) $btn = GUICtrlCreateButton("Show", 10, 10) GUISetState (@SW_SHOW) ; will display an empty dialog box $child = GUICreate("My GUI child", 100, 200, 225, 20, -1, -1, $gui) GUISetState (@SW_HIDE) ; will display an empty dialog box While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $child, "int", 500, "long", 0x00050002 );slide out to left EndIf If $msg = $btn Then DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $child , "int", 500, "long", 0x00040001 );slide in from left EndIf Wend Edited June 7, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
Raindancer Posted June 7, 2005 Author Share Posted June 7, 2005 changed:function name to _WinAnimate.added:real consts.some error handeling.made it accept both Titles & Handels.<{POST_SNAPBACK}>Jupp. I'm not that experienced in writing UDFs thank you. Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer Link to comment Share on other sites More sharing options...
w0uter Posted June 7, 2005 Share Posted June 7, 2005 Jupp. I'm not that experienced in writing UDFs thank you.<{POST_SNAPBACK}>no problem just keep up the good work. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
MHz Posted June 7, 2005 Share Posted June 7, 2005 Where abouts in the nVidia Control Panel? I can't find it.Did you mean something like this? Excuse the lameness/messiness I done it in a rush lol.<{POST_SNAPBACK}>Display properties -> Settings -> AdvancedYes, your example looks like it. Just needs alittle fix, to keep it attached to the parent.Thanks Burrup. Link to comment Share on other sites More sharing options...
buzz44 Posted June 8, 2005 Share Posted June 8, 2005 Yeah. Theres some child/parent window UDF's floating around that will do it for you, keep child attached to parent that is. One is by Xenogis and the other is by CyberSlug I think. Have fun. qq Link to comment Share on other sites More sharing options...
Groumphy Posted June 8, 2005 Share Posted June 8, 2005 Add to my script library ! Very nice. Thanks for sharing. Groumphy ----------------------GroumphyMore information about me [Fr] Link to comment Share on other sites More sharing options...
buzz44 Posted June 8, 2005 Share Posted June 8, 2005 Display properties -> Settings -> AdvancedYes, your example looks like it. Just needs alittle fix, to keep it attached to the parent.Thanks Burrup.<{POST_SNAPBACK}>I see it now, nice... They really know how to make something like good and hi-tech and all those words. qq Link to comment Share on other sites More sharing options...
DaLiMan Posted June 8, 2005 Share Posted June 8, 2005 Very COOL. I think I will use this one!!! Link to comment Share on other sites More sharing options...
Raindancer Posted June 10, 2005 Author Share Posted June 10, 2005 I found out, that those AnimatWindow functions only work with Windows XP. So I modifyed the code, so that it calls the function only if the macro @OSVersion is "WIN_XP" expandcollapse popup;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" 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 Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer Link to comment Share on other sites More sharing options...
buzz44 Posted June 10, 2005 Share Posted June 10, 2005 What happens when you try to run them on a OS other then XP? It doesn't work or do you recieve and error of some kind? qq Link to comment Share on other sites More sharing options...
awrog Posted June 10, 2005 Share Posted June 10, 2005 Works fine under Widows 2000 Professional!What happens when you try to run them on a OS other then XP? It doesn't work or do you recieve and error of some kind?<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Groumphy Posted June 10, 2005 Share Posted June 10, 2005 It's OK on Win2000 ... ----------------------GroumphyMore information about me [Fr] Link to comment Share on other sites More sharing options...
w0uter Posted June 10, 2005 Share Posted June 10, 2005 he probly ment NT-based systems. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
peethebee Posted August 12, 2005 Share Posted August 12, 2005 Hi!You might be interested in this too:Text effects UDF:http://www.autoitscript.com/forum/index.php?showtopic=14409Ciao, peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Link to comment Share on other sites More sharing options...
DaLiMan Posted August 12, 2005 Share Posted August 12, 2005 Hi, I like this UDF and I want to use it for a script of mine. Works great except I have a minor visual question...... The GUI now has little black corners (see picture attachment) Is there a way to get rid of them? Would visually be more nifty. Link to comment Share on other sites More sharing options...
buzz44 Posted August 16, 2005 Share Posted August 16, 2005 Look here > http://www.autoitscript.com/forum/index.ph...topic=12449&hl=. qq Link to comment Share on other sites More sharing options...
BigDaddyO Posted August 16, 2005 Share Posted August 16, 2005 (edited) This is very cool Is there any way to increase the speed of the effects? Mike edit: um, never mind, i just re-read it and it's right in the function. Edited August 16, 2005 by MikeOsdx 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