Delphi uses Windows API function AnimateWindow to implement form effects

Source: Internet
Author: User

{**********************************************************************
API function AnimateWindow use:
Functions: Forms are displayed and hidden to produce special animation effects, and two types of animations can be produced:
Scrolling animations and sliding animations
Function prototypes: BOOL AnimateWindow (HWND hwnd, DWORD Dwtime, DWORD DwFlags)
Parameter Description: hWnd Specifies the handle of the form that produces the animation effect;
DWTIME specifies the duration of the animation (in seconds) to complete the standard time for an animation
is 200 microseconds;
DWFLAGS Specifies the type of animation. This parameter can be a combination of one or more of the following flags;
Flag Description: Aw_slide use sliding type. The default is the scrolling animation type. When using Aw_center
Flag, this flag is ignored.
Aw_active activates the window. Do not use this flag after you have used the AW_HIDE flag.
Aw_blend use fade out effect. This flag can only be used when the HWND is the top-level window.
Aw_hide hides the window, and the window is displayed by default.
Aw_center If the Aw_hide flag is used, the window will overlap; if aw_hide is not used
Flag, it expands the window outward.
Aw_hor_positive Displays the window from left to right. The flag can be animated in scrolling and sliding
Used in the. When the Aw_center flag is used, the flag is ignored.
Aw_hor_negative Displays the window from right to left. The flag can be animated in scrolling and sliding
Used in the. When the Aw_center flag is used, the flag is ignored.
Aw_ver_positive Displays the window from top to bottom. The flag can be animated in scrolling and sliding
Used in the. When the Aw_center flag is used, the flag is ignored.
Aw_ver_negative Displays the window from the bottom up. The flag can be animated in scrolling and sliding
Used in the. When the Aw_center flag is used, the flag is ignored.
Return value: If the function succeeds, the return value is not 0, and if the function fails, the return value is zero. In the following cases
The following function will fail: The window is using the window bounds, the window is visible and the window is still displayed;
You have hidden the window that you still want to hide. To get more error messages, please call GetLastError
Number.
Note: You can aw_hor_positive or aw_hor_negtve with aw_ver_positve or aw_ver_negative
Combination to activate a window.
**********************************************************************}
Scroll up from below
Procedure Tform1.formcreate (Sender:tobject);
Begin
AnimateWindow (Handle, +, Aw_slide + aw_ver_negative);
End

Gradually fade away
Procedure Tform1.speedbutton4click (Sender:tobject);
Begin
AnimateWindow (Handle, N, aw_slide + aw_blend + aw_hide);
Application.terminate;
End

Http://www.lsworks.net/article/51.html

Delphi uses Windows API function AnimateWindow to implement form effects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.