|
-
AnimateWindow API
Hi all,
I'm trying to animate a splash screen form using the API function
AnimateWindow as shown below:
Sub Main()
Dim aFrm As New frmSpash
Load aFrm
aFrm.Move (Screen.Width - aFrm.Width) / 2, (Screen.Height - aFrm.Height) /
2
Call AnimateWindow(aFrm.hwnd, AW_DURATION_DEFAULT, AW_CENTER Or
AW_VER_POSITIVE)
aFrm.Show '-- although calling this has no affect because the form shows
afrer the _
previous line of code
aFrm.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call AnimateWindow(Me.hwnd, AW_DURATION_DEFAULT, AW_HIDE Or AW_CENTER)
Refresh
End Sub
Here are the declares:
Public Const AW_HOR_POSITIVE = &H1
Public Const AW_HOR_NEGATIVE = &H2
Public Const AW_VER_POSITIVE = &H4
Public Const AW_VER_NEGATIVE = &H8
Public Const AW_CENTER = &H10
Public Const AW_HIDE = &H10000
Public Const AW_ACTIVATE = &H20000
Public Const AW_SLIDE = &H40000
Public Const AW_BLEND = &H80000
Public Const AW_DURATION_DEFAULT = 200
Public Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, _
ByVal dwTime As Long, _
ByVal dwFlags As Long) As Long
Although the animation itself works there are two things that look very
unprofessional:
1. During the animation the from's background looks like an abstract art
painting.
2. I can only animate forms whose BorderStyle is other that 0 (and that's
the style you usually need for a splash screen)
Has any of you have a solution to those issues?
Thanks in advance
Tim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks