| |
|
|
| CompileMarkSeparationSource wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Buttons: animierte Buttons erzeugen
Autor: Dieter Zornow
30.12.2004
Code zur freien Verwendung
Def AnimateWindow(3) ! user32,AnimateWindow
Parameters
hwnd
[in] Handle to the window to animate. The calling thread must own this window.
dwTime
[in] Specifies how long it takes to play the animation, in milliseconds.
Typically, an animation takes 200 milliseconds to play.
dwFlags
[in] Specifies the type of animation. This parameter can be one or more of the following values.
Note that, by default, these flags take effect when showing a window.
To take effect when hiding a window, use AW_HIDE and a logical OR operator
with the appropriate flags.
Type Flags
Def &SHOW $20000
Def &HIDE $10000
Def &FADE $80000
Def &COLLAPSE $10
Def &ROLL $40000
Direction Flags
Def &LeftToRight $1
Def &RightToLeft $2
Def &TopToBottom $4
Def &BottomToTop $8
Def WPAINT $F
Proc ShowAniWindow
parameters hndl&,time&
Declare ok&,flags&,count&
flags& = &SHOW
count& = 1
While count& <= %PCount
flags& = flags& | @&(count& + 2)
inc count&
endwhile
ok& = AnimateWindow(hndl&,time&,flags&)
Return ok&
endproc
Proc HideAniWindow
parameters hndl&,time&
Declare ok&,flags&,count&
flags& = &Hide
count& = 1
While count& <= %PCount
flags& = flags& | @&(count& + 2)
inc count&
endwhile
ok& = AnimateWindow(hndl&,time&,flags&)
Return ok&
endproc
Beispiel
cls
Declare button&
button& = @Create(Button,%Hwnd,Animate,10,10,100,25)
sleep 500
HideAniWindow button&,1000,&COLLAPSE
sleep 500
ShowAniWindow button&,1000,&COLLAPSE
sleep 500
HideAniWindow button&,1000,&ROLL,&RightToLeft
sleep 500
ShowAniWindow button&,1000,&ROLL,&LeftToRight
sleep 500
HideAniWindow button&,1000,&ROLL,&TopToBottom
sleep 500
ShowAniWindow button&,1000,&ROLL,&BottomToTop
sleep 500
HideAniWindow button&,1000,&ROLL,&TopToBottom,&RightToLeft
sleep 500
ShowAniWindow button&,1000,&ROLL,&BottomToTop,&LeftToRight
sleep s2>800
end
|
|
|
| |
|
|