首页 > 其他 > 详细

每天一得:窗口转圈

时间:2016-12-18 10:00:28      阅读:171      评论:0      收藏:0      [点我收藏+]
#include <windows.h>

int main()
{
    int x=0, y=0;
    int status = 0;
    while (1)
    {
        if (x==0 && y==0)
        {
            status = 0;
        }
        if (x==1000 && y==0)
        {
            status = 1;
        }
        if (x==1000 && y==600)
        {
            status = 2;
        }
        if (x==0 && y == 600)
        {
            status = 3;
        }
        if (0==status)
        {
            x += 10;
        }
        if (1==status)
        {
            y += 10;
        }
        if (2==status)
        {
            x -= 10;
        }
        if (3==status)
        {
            y -= 10;
        }

        SetWindowPos((HWND)0x00050804,NULL, x, y, 500, 500, 0);
        Sleep(10);
    }
    

    return 0;
}

关键点:判断4种状态

每天一得:窗口转圈

原文:http://www.cnblogs.com/bing-z/p/6193757.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!