用SetTimer()设定计时器,会定时触发WM_TIMER消息,再处理WM_TIMER消息就可以了。

解决方案 »

  1.   

    如楼上的所述。
    另外,用完记时器记得用KillTimer();
    关掉它哦。
      

  2.   

    用gettickcount 较准确
    用settimer 较容易
      

  3.   

    分为三步:
       1.你可以添加WM_TIMER消息响应函数。onTimer(ID)
       2.在需要的地方,设置UINT m_Timer=SetTimer(1,1000,NULL);
       3.在终止的地方用KillTimer(m_Timer);
    试一试,行吗〉???
      

  4.   

    SetTimer(IDT_TIMER1,60000, NULL);   // 一分钟.
      

  5.   

    MSG msg; 
    我常用的一句
    很好哟!                DWORD dwTimeStarted;                dwTimeStarted = GetTickCount();
    //等待5秒钟
                    while(GetTickCount() - dwTimeStarted < 5000)
                    {
                        if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
                        {
                            TranslateMessage(&msg);
                            DispatchMessage(&msg);
                        }
                    }你想给我多少分?
    不用太多了..