Use AnimateWindow for window fading (there are four main animations, scrolling, sliding, folding or unwinding, and fading)

Source: Internet
Author: User

If you are compiling under VC6, you should introduce the following precompiled macro, which you should be careful to put in front of windows.h
#undef WINVER
#define WINVER 0x500
Why introduce the above macro? Look at the declaration of the API in Winuser.h:
#if (WINVER >= 0x0500)
Winuserapi
BOOL
WINAPI
AnimateWindow (
HWND hwnd,
DWORD Dwtime,
DWORD dwFlags);
#endif/* WINVER >= 0x0500 */
If you do not make the definition of this macro, the API is excluded and the compilation will have error.

Declared in Winuser.h, include Windows.h

Function Prototypes:
BOOL AnimateWindow (
HWND hwnd,
DWORD Dwtime,
DWORD dwFlags);

function function:
This function can produce special types of animations when displaying and hiding windows, with four animations, scrolling, sliding, folding or unfolding, and fading.

Parameter meaning:
HWND: Specifies the handle of the window that produces the animation.
Dwtime: Indicates the duration of the animation (in microseconds), and the standard time to complete an animation is 200 microseconds.
Dwfags: Specifies the type of animation, which can be a combination of one or more of the following flags. Logo Description:
Aw_slide: Using the sliding type, the default is the scrolling animation type, which is ignored when the Aw_center flag is used.
Aw_activate: Activates the window and does not work with the AW_HIDE flag.
Aw_blend: Fade-out effect is achieved. This flag can only be used when the HWND is the top-level window.
Aw_hide: Hides the window and displays the window by default.
Aw_center: If the aw_hide flag is used, the window is overlapped, that is, the window is shrunk, and if the AW_HIDE flag is not used, the window is expanded outward.
Aw_hor_positive: Displays the window from left to right. This flag can be used in scrolling animations and slide animations. When the Aw_center or Aw_blend flag is used, the flag is ignored.
Aw_ver_positive: Displays the window from top to bottom. This flag can be used in scrolling animations and slide animations. When the Aw_center or Aw_blend flag is used, the flag is ignored.
Aw_ver_negative: Displays the window from the bottom up. This flag can be used in scrolling animations and slide animations. When the Aw_center or Aw_blend 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. The function will fail in the following cases:
1, if the window uses the window area, but XP will not fail;
2, the window has been shown, you also want to use this API to display the window;
3, the window has disappeared, you try to hide the window through this API;
4. No direction is specified for scrolling or sliding;
5, to a sub-window using Aw_blend;
6. The thread calling this API does not own the window specified by the HWND;

Function Information:
Minimum DLL version: User32.dll
Header files: Declared in Winuser.h, include Windows.h
Libraries introduced: User32.lib
Minimum operating system: Windows 98, Windows 2000

Note: When using AnimateWindow to fade out, the window will not receive mouse messages, if you have the need: when the window fades away, if the mouse moved up, the window back to normal display, and does not disappear. There is no way to use AnimateWindow, is there any other way? Next time we Talk, O (∩_∩) o ....

[END]

http://blog.csdn.net/magictong/article/details/4074394

Use AnimateWindow for window fading (there are four main animations, scrolling, sliding, folding or unwinding, and fading)

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.