Windows API one-day training (39) animatewindow Function
Source: Internet
Author: User
Windows API one-day training (39) animatewindow Function
When you develop software for young people, you must want to use dynamic features to attract them. For example, QQ Software has this feature. When you place it on the edge of the desktop, it will be automatically hidden. When you place your mouse there, it will automatically move slowly, the pair has dynamic characteristics and will certainly make young people like it. In addition, when you develop software and want to dynamically display the company's trademark or company's promotional materials, the flash screen will be used. In fact, both features can be implemented using the API function animatewindow. The following describes how to use it.
The animatewindow function is declared as follows:
# If (winver> = 0x0500)
Winuserapi
Bool
Winapi
Animatewindow (
_ In hwnd,
_ In DWORD dwtime,
_ In DWORD dwflags );
# Endif/* winver> = 0x0500 */
Hwnd is the handle of the window.
Dwtime is the time of dynamic appearance.
Dwflags indicates the display effect.
An example of calling this function is as follows:
#001 // message processing function.
#002 //
#005 //
#006 lresult ccaiwinmsg: onmessage (uint nmessage,
#007 wparam, lparam)
#008 {
#009 //
#010 switch (nmessage)
#011 {
#012 case wm_paint:
#013 return onpaint (wparam, lparam );
#014 break;
#015 case wm_create:
#016
#017 break;
#018 case wm_destroy:
#019 return ondestroy (wparam, lparam );
#020 break;
#021 case wm_activateapp:
#022 if (wparam = true)
#023 {
#024 // The window is displayed from top to bottom.
#025 animatewindow (m_hwnd, 1000, aw_slide | aw_ver_positive );
#026}
#027 else
#028 {
#029 // hide the window from bottom to top.
#030 animatewindow (m_hwnd, 1000, aw_hide | aw_ver_negative );
#031}
#032 break;
#033}
#034
#035 return ccaiwin: onmessage (nmessage, wparam, lparam );
#036}
#037
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.