如何在VC6。0 MFC 编程实现延时,有相应的API函数吗?

解决方案 »

  1.   

    VOID Sleep(
      DWORD dwMilliseconds   // sleep time
    );
    Parameters
    dwMilliseconds 
    [in] Specifies the time, in milliseconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. A value of INFINITE causes an infinite delay. 
    Return Values
    This function does not return a value. 
      

  2.   

    VOID Sleep(
      DWORD dwMilliseconds   // sleep time
    );
    或自己来掩饰
    for(int i=0;i<100000;i++)
    ;
      

  3.   

    用SetTimer(UINT nIDEvent, UINT nElapse)
    BOOL KillTimer( UINT nIDEvent )来实现线程很好。