Anyway this might be much easier to use, especially for beginners
AnimateWindow(id,delay,options)
Thanks infogulch for your great examples
AnimateWindow - DllCall Test Script with Code Generator
Easily include the one of the following character in options.
A=ACTIVATE
H=HIDE
C=CENTER
B=BLEND
S=SLIDE
- For slide effect include SD for slide down, SU=Up
- SR to slide from left to right, SL=right to left
For example:
Gui,+LastFound
GuiID:=WinExist()
Gui,Show, Hide Center w200 h200
AnimateWindow(hwnd, 1000,"BA")
sleep, 1000
AnimateWindow(hwnd, 1000,"BH")
sleep, 1000
AnimateWindow(hwnd,1000,"SLA")
sleep, 1000
AnimateWindow(hwnd,1000,"SRH")
options=C|B|SD|SU|SL|SR|SRD|SLU
delay=1000
Loop
Loop,Parse,options,|
{
AnimateWindow(GuiID,delay,A_LoopField . "A")
Sleep, %delay%
AnimateWindow(GuiID,delay,A_LoopField . "H")
Sleep, %delay%
}
GuiClose:
ExitApp
AnimateWindow(hwnd,time,options){ local H:=0x10000, A:=0x20000,C:=0x10, B:= 0x80000,S:=0x40000,R:= 0x1, L:=0x2, D:=0x4, U:=0x8,O:="HACBSLURD",opt:="",format:="" format:= A_FormatInteger SetFormat, integerfast, Hex opt := 0x0 + 0 Loop,parse,Options If InStr(O,A_LoopField) opt |= %A_LoopField% If opt DllCall("AnimateWindow", "UInt", hwnd, "Int", time, "UInt", opt) SetFormat, integerfast,%format% }
; AHK 1.0.48.00 AnimateWindow(hwnd,time,options) { Static H:=0x10000, A:=0x20000, C:=0x10, B:=0x80000, S:=0x40000, R:=0x1 Static L:=0x2, D:=0x4, U:=0x8, O:="HACBSLURD" Loop,Parse,options If InStr(O,A_LoopField) opt+=(%A_LoopField%) If opt DllCall("AnimateWindow", "UInt", hwnd, "Int", time, "UInt", opt) }