Code: Select all
/*
http://msdn.microsoft.com/library/ms632669
BOOL WINAPI AnimateWindow(
_In_ HWND hwnd,
_In_ DWORD dwTime,
_In_ DWORD dwFlags
);
*/
AW_BLEND := 0x00080000 ; Uses a fade effect.
AW_SLIDE := 0x00040000 ; Uses slide animation. By default, roll animation is used.
AW_CENTER := 0x00000010 ; Animate collapse/expand to/from middle.
AW_HIDE := 0x00010000 ; Hides the window. By default, the window is shown.
AW_ACTIVATE := 0x00020000 ; Activates the window. Do not use this value with AW_HIDE.
AW_HOR_POSITIVE := 0x00000001 ; Animates the window from left to right.
AW_HOR_NEGATIVE := 0x00000002 ; Animates the window from right to left.
AW_VER_POSITIVE := 0x00000004 ; Animates the window from top to bottom.
AW_VER_NEGATIVE := 0x00000008 ; Animates the window from bottom to top.
AnimateWindow(h,t,f) {
return DllCall("AnimateWindow","UInt",h,"UInt",t,"UInt",f)
}
#NoEnv
#SingleInstance, Ignore
SetBatchLines -1
SetWinDelay 0
Gui, +HwndhGUI +ToolWindow
Gui, Color, c1A1A1A
Gui, Font, s18 cFEFEFE
Gui, Add, Text, x0 y224 w640 Center, AnimateWindow Test
Gui, Font, s8 cFEFEFE
Gui, Add, Text, x0 y+4 wp Center, Press Space to animate this window.
Gui, Show, w640 h480
GroupAdd,hGroup,ahk_id %hGUI%
return
GuiClose:
ExitApp
#IfWinActive ahk_group hGroup
Space::
AW_TIME:=500
MsgBox AnimateWindow : Fade In/Out
AnimateWindow(hGUI, AW_TIME, AW_BLEND|AW_HIDE) ;Hide
AnimateWindow(hGUI, AW_TIME, AW_BLEND) ;Show
MsgBox AnimateWindow : Roll Horizontal
AnimateWindow(hGUI, AW_TIME, AW_HOR_POSITIVE|AW_HIDE) ;Hide
AnimateWindow(hGUI, AW_TIME, AW_HOR_NEGATIVE) ;Show
MsgBox AnimateWindow : Roll Vertical
AnimateWindow(hGUI, AW_TIME, AW_VER_POSITIVE|AW_HIDE) ;Hide
AnimateWindow(hGUI, AW_TIME, AW_VER_NEGATIVE) ;Show
MsgBox AnimateWindow : Slide Horizontal
AnimateWindow(hGUI, AW_TIME, AW_HOR_POSITIVE|AW_SLIDE|AW_HIDE) ;Hide
AnimateWindow(hGUI, AW_TIME, AW_HOR_NEGATIVE|AW_SLIDE) ;Show
MsgBox AnimateWindow : Slide Vertical
AnimateWindow(hGUI, AW_TIME, AW_VER_POSITIVE|AW_SLIDE|AW_HIDE) ;Hide
AnimateWindow(hGUI, AW_TIME, AW_VER_NEGATIVE|AW_SLIDE) ;Show
MsgBox AnimateWindow : Roll Collapse/Expand to/from middle
AnimateWindow(hGUI, AW_TIME, AW_CENTER|AW_HIDE) ;Hide
AnimateWindow(hGUI, AW_TIME, AW_CENTER) ;Show
MsgBox AnimateWindow : Done!
return