Wednesday, April 29, 2009

Anime Window

'Animate Window


Const AW_HOR_POSITIVE = &H1  
 'Animates the window from left to right.

Const AW_HOR_NEGATIVE = &H2 
'Animates the window from right to left.

Const AW_VER_POSITIVE = &H4   
 'Animates the window from top to bottom.

Const AW_VER_NEGATIVE = &H8  
'Animates the window from bottom to top.



Const AW_CENTER = &H10

Const AW_HIDE = &H10000            
'Hides the window.

Const AW_ACTIVATE = &H20000  
'Activates the window.

Const AW_SLIDE = &H40000           
'Uses slide animation.

Const AW_BLEND = &H80000        
 'Uses a fade effect.




Private Declare Function AnimateWindow
Lib "user32" _

(ByVal hwnd As Long, ByVal dwTime As Long, _

ByVal dwFlags As Long)
As Boolean



Private Sub Form_Load()

'Set the graphic mode to persistent

Me.AutoRedraw = True

Me.Print "Unload me"

End Sub



Private Sub Form_Unload(Cancel
As Integer)

'Animate the window

AnimateWindow Me.hwnd, 200, AW_VER_POSITIVE Or AW_HOR_NEGATIVE
Or AW_HIDE

'Unload our form completely

Set Form1 = Nothing

End Sub



 

No comments:

Post a Comment