Http://www.delphibbs.com/keylife/iblog_show.asp? Xid = 33357
Http://www.delphibbs.com/keylife/iblog_show.asp? Xid = 261
// ================================================ ==================
Private declare function animatewindow lib "USER32" (byval hwnd as long,
Byval dwtime as long, byval dwflags as long) as long
Where:
Hwnd is only valid for form, and other effects such as picture1 cannot be produced.
Dwtime is the animation duration. The default value is 200.
Dwflags has the following values:
Aw_hor_positive (& H1) 'opens the window from left to right
Aw_hor_negative (& H2) 'opens the window from right to left.
Aw_ver_positive (& h4) 'opens the window from top to bottom
Aw_ver_negative (& H8) 'opens the window from bottom to top.
Aw_center (& H10) 'cannot see any effect
Aw_hide (& h10000) 'This constant must be added if you want to use this function during form uninstallation
Aw_activate (& h20000) 'After the form is opened through this function, the focus will be lost by default, unless this constant is added
Aw_slide (& h40000) 'does not show any effect
Aw_blend (& h80000) 'fade-in and fade-out effect
The last one is what I am looking for. Unfortunately, it is only valid for Win2000. Below is the form fade-in effect,
If we don't have Win2000, we won't be able to see it:
Form1.borderstyle = 1
Form1.caption = ""
Form1.controlbox = ""
Attach a suitable background image to form1.
Private sub form_click ()
Unload me
End sub
Private sub form_unload (cancel as integer)
Animatewindow hwnd, 1000, & h80000 + & h10000
Set form1 = nothing
End sub
The animatewindow function adds a lot of colors to programs, especially for Win2000.
You can use it in Delphi by modifying it as appropriate.