在一篇文章里面看到一个函数:AnimateWindow,按f1搜索msdn,找到定义:CWnd::AnimateWindowSee Also
CWnd Overview | Class Members | Hierarchy Chart
Produces special effects when showing or hiding windows.BOOL AnimateWindow(
DWORD dwTime,
DWORD dwFlags
);
Parameters
dwTime
Specifies how long it takes to play the animation, in milliseconds. Typically, an animation takes 200 milliseconds to play.
dwFlags
Specifies the type of animation. For a full list of possible values, see AnimateWindow.
Return Value
Nonzero if the function succeeds; otherwise 0.我把鼠标放在这个函数上面,,她显示是BOOL CWnd::AnimateWindow(DWORD dwTime, DWORD dwFlags);
可是我编译的时候居然告诉我“error C2065: “AnimateWindow” : 未声明的标识符”,,,,,,我都已经加了要求的头文件了~!!!
CWnd Overview | Class Members | Hierarchy Chart
Produces special effects when showing or hiding windows.BOOL AnimateWindow(
DWORD dwTime,
DWORD dwFlags
);
Parameters
dwTime
Specifies how long it takes to play the animation, in milliseconds. Typically, an animation takes 200 milliseconds to play.
dwFlags
Specifies the type of animation. For a full list of possible values, see AnimateWindow.
Return Value
Nonzero if the function succeeds; otherwise 0.我把鼠标放在这个函数上面,,她显示是BOOL CWnd::AnimateWindow(DWORD dwTime, DWORD dwFlags);
可是我编译的时候居然告诉我“error C2065: “AnimateWindow” : 未声明的标识符”,,,,,,我都已经加了要求的头文件了~!!!
即Win2000SERVER/XP才可以
不过只要你的系统是98以上也可以通过修改vc头文件实现
打开WINUSER.H
找到这个函数声明
将
#if WINVER>=5.0#endif
删除,保存后
Rebuild All your project.
if(hInst)
{
typedef BOOL (WINAPI *MYFUNC)(HWND,DWORD,DWORD);
MYFUNC fun = NULL;
//取得SetLayeredWindowAttributes函数指针
fun = (MYFUNC)GetProcAddress(hInst, "AnimateWindow");
if(fun)
{
fun(m_hWnd, 400, 0x00000010);
}
FreeLibrary(hInst);
}