AnimateWindow Function
Declaration:
Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, ByVal dwTime As Long, ByVal dwFlags As Long) As Boolean
Platforms:
· 10510m1218k 10510m1218k Windows: Requires version 95 or later
· 10510m1218k 10510m1218k Windows NT: Requires Windows NT 3.1 or later.
· 10510m1218k 10510m1218k Windows CE: Not Supported.
Description:
The AnimateWindow function enables you to produce special effects when showing or hiding windows. There are three types of animation: roll, slide, and alpha-blended fade.
Return Value:
If the function succeeds, the return value is nonzero.
Parameters:
hwnd
Specifies a handle to the window to animate.
dwTime
Specifies how long it takes to play the animation, in milliseconds. Typically, an animation takes 200 milliseconds to play.
dwFlags
Specifies the type of animation. This parameter can be one or more of the following flags.
Flag |
Description |
AW_SLIDE |
Uses slide animation. By default, roll animation is used. This flag is ignored when used with the AW_CENTER flag. |
AW_ACTIVATE |
Activates the window. Do not use this flag with AW_HIDE. |
AW_BLEND |
Uses a fade effect. This flag can be used only if hwnd is a top-level window. |
AW_HIDE |
Hides the window. By default, the window is shown. |
AW_CENTER |
Makes the window appear to collapse inward if the AW_HIDE flag is used or expand outward if the AW_HIDE flag is not used. |
AW_HOR_POSITIVE |
Animate the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with the AW_CENTER flag. |
AW_HOR_NEGATIVE |
Animate the window from right to left. This flag can be used with roll or slide animation. It is ignored when used with the AW_CENTER flag. |
AW_VER_POSITIVE |
Animate the window from top to bottom. This flag can be used with roll or slide animation. It is ignored when used with the AW_CENTER flag. |
AW_VER_NEGATIVE |
Animate the window from bottom to top. This flag can be used with roll or slide animation. It is ignored when used with the AW_CENTER flag. |
Example:
'You need a Commandbutton for this project
Const AW_HOR_POSITIVE = &H1
Const AW_HOR_NEGATIVE = &H2
Const AW_VER_POSITIVE = &H4
Const AW_VER_NEGATIVE = &H8
Const AW_CENTER = &H10
Const AW_HIDE = &H10000
Const AW_ACTIVATE = &H20000
Const AW_SLIDE = &H40000
Const AW_BLEND = &H80000
Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, ByVal dwTime As Long, ByVal dwFlags As Long) As Boolean
Private Sub Command1_Click()
'Animate the window
AnimateWindow Me.hwnd, 1000, AW_HIDE Or AW_CENTER
'Clean Up
Set Form1 = Nothing
Unload Me
End Sub
Private Sub Form_Load()
Command1.Caption = "Animate this window"
End Sub
Related Functions:
FlashWindow, FlashWindowEx
Back
©1999-2000 VBGreatone. All rights reserved.
|