调用 AnimateWindow 函数, 编译时提示: 找不到标识符

maohbao 2008-07-19 11:29:04
我的工程是从 vc++6.0 转换过来的, AnimateWindow 函数为什么在vs2005中不支持,怎么办?谢谢!
...全文
50 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
maohbao 2008-07-20
  • 打赏
  • 举报
回复
我是在 vc++ 2005 中开发,代码该怎么写呢? 怎么导入 AnimateWindow 函数?
家鸣 2008-07-19
  • 打赏
  • 举报
回复
AnimateWindow 函数是Windows的API,调用如下:
[DllImport("user32")]
private static extern bool AnimateWindow(IntPtr hwnd,int dwtime,int nflag);
//nflag的取值如下
public const Int32 AW_HOR_POSITIVE = 0x00000001; //从左到右显示
public const Int32 AW_HOR_NEGATIVE = 0x00000002; //从右到左显示
public const Int32 AW_VER_POSITIVE = 0x00000004; //从上到下显示
public const Int32 AW_VER_NEGATIVE = 0x00000008; //从下到上显示
public const Int32 AW_CENTER = 0x00000010; //若使用了AW_HIDE标志,则使窗口向内重叠,即收缩窗口;否则使窗口向外扩展,即展开窗口
public const Int32 AW_HIDE = 0x00010000; //隐藏窗口,缺省则显示窗口
public const Int32 AW_ACTIVATE = 0x00020000; //激活窗口。在使用了AW_HIDE标志后不能使用这个标志
public const Int32 AW_SLIDE = 0x00040000; //使用滑动类型。缺省则为滚动动画类型。当使用AW_CENTER标志时,这个标志就被忽略
public const Int32 AW_BLEND = 0x00080000; //透明度从高到低


CLOSE_OR_OPEN = AW_ACTIVATE; //打开
//CLOSE_OR_OPEN = AW_HIDE; //关闭

IntPtr hwnd = this.Handle;//窗口句柄

animatewindow(hwnd,200,AW_HOR_POSITIVE|CLOSE_OR_OPEN); //从左向右显示

animatewindow(hwnd,200,AW_HOR_NEGATIVE|CLOSE_OR_OPEN); //从右向左显示

animatewindow(hwnd,200,AW_VER_POSITIVE|CLOSE_OR_OPEN); //从上到下显示

animatewindow(hwnd,200,AW_VER_NEGATIVE|CLOSE_OR_OPEN); //从下到上显示

animatewindow(hwnd,200,AW_SLIDE|AW_HOR_POSITIVE|AW_VER_POSITIVE|CLOSE_OR_OPEN); //左上角伸展

animatewindow(hwnd,200,AW_SLIDE|AW_HOR_POSITIVE|AW_VER_POSITIVE|CLOSE_OR_OPEN); //左下角伸展

animatewindow(hwnd,200,AW_SLIDE|AW_HOR_NEGATIVE|AW_VER_NEGATIVE|CLOSE_OR_OPEN); //右上角伸展

animatewindow(hwnd,200,AW_SLIDE|AW_HOR_NEGATIVE|AW_VER_NEGATIVE|CLOSE_OR_OPEN); //右下角伸展

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧