vc++中调用AnimateWindow动态建立窗口(转)
来源:互联网 发布:seo最好的cms 编辑:程序博客网 时间:2024/06/05 01:51
1:首先建立一个单文档工程
2:在CMainNFrame的OnCreate()中添加函数调用
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) // stdafx.h : include file for standard system include files, 就是下面这2行 再编译就会发现一切ok. 原文出处:http://www.cnblogs.com/Richinger/archive/2005/07/22/197871.html
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
..... ....
..........
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
AnimateWindow(GetSafeHwnd(),2000,AW_SLIDE|AW_HOR_POSITIVE);
return 0;
}
这样就有了建立窗口的过程
3:在CMainNFrame类中添加OnClose()消息
void CMainFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
AnimateWindow(GetSafeHwnd(),2000,AW_HIDE|AW_CENTER);
CFrameWnd::OnClose();
}
这样就建立了关闭窗口的动态过程
4:光作上面的工作你还无法完成整个调用过程,因为在编译时你可能会遇到如下情况:
'AnimateWindow' ,AW_HIDE,AW_CENTER:undeclared identifier
通常碰到这种情况我们可能都会以为是少了包含,AnimateWindow()定义在winuser.h中,在stdafx.h
添加#include<winuser.h>后应该可以了吧,重新编译发现上面的问题是没有了,但是又出来了新的
问题
syntax error : missing ';' before identifier 'HDWP'
fatal error C1004: unexpected end of file found
为什么,难道不能调用?后来查了些资料,问题还是没有解决,最后有个网友提醒我,其实不用在
stdafx.h中添加#include<winuser.h>
在stdafx.h添加如下2行就可以了
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__4724EEBC_1F0B_477B_9BB6_2860AA382394__INCLUDED_)
#define AFX_STDAFX_H__4724EEBC_1F0B_477B_9BB6_2860AA382394__INCLUDED_
#undef WINVER
#define WINVER 0X500
- vc++中调用AnimateWindow动态建立窗口(转)
- VC中AnimateWindow函数用法(窗口的淡入淡出)
- 动态窗口实现(API函数AnimateWindow详解)
- 动态窗口实现(API函数AnimateWindow详解)
- VC++ AnimateWindow
- VC:用AnimateWindow函数实现窗口动画效果
- (转)VC调用C#动态库,建立ARX FOR VC工程
- AnimateWindow 窗口渐入渐出
- AnimateWindow实现窗口动画
- VC++建立动态库
- VC中调用动态库文件Dll
- 用AnimateWindow函数可以实现多种窗口的多种动态效果
- VC中窗口指针的关系以及相互调用
- VC动态建立ODBC数据源
- VC动态调用DLL
- VC动态调用DLL
- vc 调用动态库
- AnimateWindow
- 十年总结(15):产品化-有心杀敌,无力回天
- 字符串转换为整数的常用算法
- 在部署jbpm4 到ssh2时出现java.lang.LinkageError: loader constraints violated when linking javax/el/ExpressionFactory class
- js 去除左右空格 最精炼的函数
- 爱需要一份贴心的暖
- vc++中调用AnimateWindow动态建立窗口(转)
- 从米饭开始的爱情同样甜蜜
- VPN相关
- ~_AFX_CTL3D_THREAD 问题的解决
- ibatis的第一个程序
- Windows下查看端口被占用的解决方案
- 主流的软件开发语言介绍
- 程序员,应该掌握的英语词汇
- SQL查询数据库表名