Because the work is too busy, long time no write program code, but the fun of writing programs I am happy.
Every day to deal with the computer, a busy forget to rest, make the eyes are spent ~
In order to protect the eyes, I decided to write a timed mandatory rest procedure ~
Although there are a lot of such programs, but DIY is still good ~
First consider the implementation of the Countdown prompt window, you want to let the window gradually out ~
This is accomplished using the API function AnimateWindow encapsulated in user32.dll.
The function prototype is:
BOOLAnimateWindow(
HWNDhwnd,//指定产生动画窗口的句柄;
DWORDdwTime,//指明动画持续的时间(以微秒计),完成一个动画的标准时间为200微秒;
DWORDdwFlags//指定动画类型。这个参数可以是一个或多个标志的组合。
);
dwflags Valid values::
Aw_slide: Use sliding type. The default is the scrolling type. Be ignored when using Aw_center flag;
Aw_activate: Activates the window. This sign cannot be used after the use of the Aw_hide logo;
Aw_blend: To achieve fade out effect. This flag can only be used when the HWND is a top-level window;
Aw_hide: Hides the window, by default displays the window;
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 to expand the window;
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 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 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 flag is used, the flag is ignored;
Return value: If the function succeeds, the return value is not 0; if the function fails, the return value is zero.